public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* media/radio/radio-si470x.c: check-after-use
@ 2008-01-28 22:13 Adrian Bunk
  2008-01-28 22:43 ` [PATCH] radio-si470x.c: check-after-use Tobias Lorenz
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2008-01-28 22:13 UTC (permalink / raw)
  To: Tobias Lorenz, mchehab; +Cc: v4l-dvb-maintainer, linux-kernel

The Coverity checker spotted the following check-after-use in 
drivers/media/radio/radio-si470x.c:

<--  snip  -->

...
static void si470x_usb_driver_disconnect(struct usb_interface *intf)
{
        struct si470x_device *radio = usb_get_intfdata(intf);

        del_timer_sync(&radio->timer);    <------------------
        flush_scheduled_work();

        usb_set_intfdata(intf, NULL);
        if (radio) {                      <------------------
                video_unregister_device(radio->videodev);
                kfree(radio->buffer);
                kfree(radio);
        }
}
...

<--  snip  -->

Either "radio" can be NULL and this case has to be properly handled or 
the NULL check is not required.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-29 20:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-28 22:13 media/radio/radio-si470x.c: check-after-use Adrian Bunk
2008-01-28 22:43 ` [PATCH] radio-si470x.c: check-after-use Tobias Lorenz
2008-01-29 19:37   ` Oliver Neukum
2008-01-29 20:37     ` Tobias Lorenz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox