From: Alexey Khoroshilov Date: Thu, 11 Jun 2015 22:50:45 +0000 (+0300) Subject: bfa: fix leak of bfad_im_port_index on module unload X-Git-Tag: Ubuntu-snapdragon-4.4.0-1029.32~5991^2~73 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=3ff448b5b7dc7ad4d664588c343da1e5e2ce18dd;p=mirror_ubuntu-zesty-kernel.git bfa: fix leak of bfad_im_port_index on module unload Resources allocated within bfad_im_port_index idr are not deallocated on module unload. The patch adds idr_destroy() in exit function. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Reviewed-by: Johannes Thumshirn Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index 7223b0006740..8367c11d554b 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c @@ -851,6 +851,8 @@ bfad_im_module_exit(void) if (bfad_im_scsi_vport_transport_template) fc_release_transport(bfad_im_scsi_vport_transport_template); + + idr_destroy(&bfad_im_port_index); } void