bfa: fix leak of bfad_im_port_index on module unload
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Thu, 11 Jun 2015 22:50:45 +0000 (01:50 +0300)
committerJames Bottomley <JBottomley@Odin.com>
Wed, 12 Aug 2015 18:31:28 +0000 (11:31 -0700)
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 <khoroshilov@ispras.ru>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/bfa/bfad_im.c

index 7223b00067405171191aaae4d4156a7b9061f230..8367c11d554b22a6fb5b7c5385b56bbc7f156f45 100644 (file)
@@ -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