1
linux/drivers/media/dvb/siano
Jesper Juhl 08921ac9e9 [media] Media, DVB, Siano, smsusb: Avoid static analysis report about 'use after free'
In drivers/media/dvb/siano/smsusb.c we have this code:
 ...
               kfree(dev);

               sms_info("device %p destroyed", dev);
 ...

at least one static analysis tool (Coverity Prevent) complains about this
as a use-after-free bug.
While it's true that we do use the pointer variable after freeing it, the
only use is to print the value of the pointer, so there's not actually any
problem here. But still, silencing the complaint is trivial by just moving
the kfree() call below the sms_info(), so why not just do it?. It doesn't
change the workings of the code in any way, but it makes the tool shut up.
The patch below also removes a rather pointless blank line.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20 09:28:57 -03:00
..
Kconfig [media] rc: rename the remaining things to rc_core 2010-12-29 08:16:50 -02:00
Makefile
sms-cards.c [media] rc/keymaps: Rename Hauppauge table as rc-hauppauge 2011-03-22 19:24:14 -03:00
sms-cards.h V4L/DVB: sms: Convert IR support to use the Remote Controller core 2010-08-02 16:43:56 -03:00
smscoreapi.c [media] ir-core: make struct rc_dev the primary interface 2010-12-29 08:16:37 -02:00
smscoreapi.h
smsdvb.c Fix common misspellings 2011-03-31 11:26:23 -03:00
smsendian.c
smsendian.h
smsir.c [media] rc: Rename remote controller type to rc_type instead of ir_type 2010-12-29 08:16:50 -02:00
smsir.h [media] rc: rename the remaining things to rc_core 2010-12-29 08:16:50 -02:00
smssdio.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
smsusb.c [media] Media, DVB, Siano, smsusb: Avoid static analysis report about 'use after free' 2011-05-20 09:28:57 -03:00