linux_dsm_epyc7002/drivers/net/wireless/iwlwifi
Julia Lawall c37457e69f drivers/net/wireless/iwlwifi: introduce missing kfree
Move orthogonal error handling code up before a kzalloc, so that it
doesn't have to free the allocated data.

The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,f1,l;
position p1,p2;
expression *ptr != NULL;
@@

x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
     when != if (...) { <+...x...+> }
(
x->f1 = E
|
 (x->f1 == NULL || ...)
|
 f(...,x->f1,...)
)
...>
(
 return \(0\|<+...x...+>\|ptr\);
|
 return@p2 ...;
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-03 16:31:22 -04:00
..
iwl3945-base.c cfg80211: fix regression on beacon world roaming feature 2009-08-03 16:31:21 -04:00
iwl-1000.c
iwl-3945-fh.h
iwl-3945-hw.h
iwl-3945-led.c iwl3945/iwlwifi: fix led bug when SW rfkill 2009-06-04 10:58:10 -04:00
iwl-3945-led.h
iwl-3945-rs.c iwlwifi: unify station management 2009-06-04 10:56:20 -04:00
iwl-3945.c iwlwifi: unify station management 2009-06-04 10:56:20 -04:00
iwl-3945.h iwlagn: fix minimum number of queues setting 2009-07-27 15:19:35 -04:00
iwl-4965-hw.h
iwl-4965.c iwlwifi: unify station management 2009-06-04 10:56:20 -04:00
iwl-5000-hw.h iwlwifi: Temperature sensor voltage reading for 5150 2009-05-22 14:06:03 -04:00
iwl-5000.c iwlwifi: unify station management 2009-06-04 10:56:20 -04:00
iwl-6000-hw.h
iwl-6000.c iwlwifi: unify station management 2009-06-04 10:56:20 -04:00
iwl-agn-rs.c iwlwifi: add value and range define for link quality command 2009-06-04 10:58:12 -04:00
iwl-agn-rs.h iwlagn: improve rate scale table search 2009-05-11 15:24:01 -04:00
iwl-agn.c iwlwifi: only show active power level via sysfs 2009-07-21 12:07:31 -04:00
iwl-calib.c iwlwifi: clean up PS code 2009-05-11 15:23:59 -04:00
iwl-calib.h
iwl-commands.h iwlwifi: add value and range define for link quality command 2009-06-04 10:58:12 -04:00
iwl-core.c cfg80211: fix regression on beacon world roaming feature 2009-08-03 16:31:21 -04:00
iwl-core.h iwlwifi: port to cfg80211 rfkill 2009-06-10 13:27:49 -04:00
iwl-csr.h iwlagn: co-exist with AMT 2009-05-22 14:06:09 -04:00
iwl-debug.h iwlwifi: support NVM access (EEPROM/OTP) 2009-05-22 14:06:04 -04:00
iwl-debugfs.c drivers/net/wireless/iwlwifi: introduce missing kfree 2009-08-03 16:31:22 -04:00
iwl-dev.h iwlagn: fix minimum number of queues setting 2009-07-27 15:19:35 -04:00
iwl-eeprom.c iwlwifi: fix otp access init 2009-06-03 14:05:09 -04:00
iwl-eeprom.h iwlwifi: support NVM access (EEPROM/OTP) 2009-05-22 14:06:04 -04:00
iwl-fh.h
iwl-hcmd.c
iwl-helpers.h
iwl-io.h iwlcore: register locks 2009-05-22 14:06:04 -04:00
iwl-led.c iwl3945/iwlwifi: fix led bug when SW rfkill 2009-06-04 10:58:10 -04:00
iwl-led.h
iwl-power.c iwlwifi: clean up PS code 2009-05-11 15:23:59 -04:00
iwl-power.h iwlwifi: clean up PS code 2009-05-11 15:23:59 -04:00
iwl-prph.h
iwl-rx.c iwlcore: Set rb_timeout to 0x10 for devices with ICT 2009-05-22 14:06:09 -04:00
iwl-scan.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-05-25 01:42:21 -07:00
iwl-spectrum.c
iwl-spectrum.h
iwl-sta.c iwlwifi: add value and range define for link quality command 2009-06-04 10:58:12 -04:00
iwl-sta.h iwlwifi: unify station management 2009-06-04 10:56:20 -04:00
iwl-tx.c iwlwifi: Read outside array bounds 2009-07-27 15:19:37 -04:00
Kconfig Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-06-15 03:02:23 -07:00
Makefile iwlwifi: port to cfg80211 rfkill 2009-06-10 13:27:49 -04:00