linux_dsm_epyc7002/drivers/infiniband/hw
Johannes Thumshirn d8b2ba7c59 IB/core: Destroy ocrdma_dev_id IDR on module exit
Destroy ocrdma_dev_id IDR on module exit, reclaiming the allocated memory.

This was detected by the following semantic patch (written by Luis Rodriguez
<mcgrof@suse.com>)
<SmPL>
@ defines_module_init @
declarer name module_init, module_exit;
declarer name DEFINE_IDR;
identifier init;
@@

module_init(init);

@ defines_module_exit @
identifier exit;
@@

module_exit(exit);

@ declares_idr depends on defines_module_init && defines_module_exit @
identifier idr;
@@

DEFINE_IDR(idr);

@ on_exit_calls_destroy depends on declares_idr && defines_module_exit @
identifier declares_idr.idr, defines_module_exit.exit;
@@

exit(void)
{
 ...
 idr_destroy(&idr);
 ...
}

@ missing_module_idr_destroy depends on declares_idr && defines_module_exit && !on_exit_calls_destroy @
identifier declares_idr.idr, defines_module_exit.exit;
@@

exit(void)
{
 ...
 +idr_destroy(&idr);
 }

</SmPL>

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2015-07-14 13:20:16 -04:00
..
amso1100 IB/mad: Add support for additional MAD info to/from drivers 2015-06-12 14:49:17 -04:00
cxgb3 IB/mad: Add support for additional MAD info to/from drivers 2015-06-12 14:49:17 -04:00
cxgb4 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-06-24 16:49:49 -07:00
ehca IB/mad: Remove improper use of BUG_ON 2015-07-14 13:20:08 -04:00
ipath IB/ipath: Convert use of __constant_<foo> to <foo> 2015-07-14 13:20:13 -04:00
mlx4 IB/mlx4: Optimize do_slave_init 2015-07-14 13:20:15 -04:00
mlx5 IB/mad: Remove improper use of BUG_ON 2015-07-14 13:20:08 -04:00
mthca IB/mad: Remove improper use of BUG_ON 2015-07-14 13:20:08 -04:00
nes RDMA/nes: Fix for incorrect recording of the MAC address 2015-07-14 13:20:11 -04:00
ocrdma IB/core: Destroy ocrdma_dev_id IDR on module exit 2015-07-14 13:20:16 -04:00
qib IB/mad: Remove improper use of BUG_ON 2015-07-14 13:20:08 -04:00
usnic IB/core: Pass hardware specific data in query_device 2015-06-12 14:49:10 -04:00
Makefile IB: Allow build of hw/ and ulp/ subdirectories independently 2014-06-02 14:51:12 -07:00