From: Adrian Bunk <bunk@kernel.org>
To: Tobias Lorenz <tobias.lorenz@gmx.net>, mchehab@infradead.org
Cc: v4l-dvb-maintainer@linuxtv.org, linux-kernel@vger.kernel.org
Subject: media/radio/radio-si470x.c: check-after-use
Date: Tue, 29 Jan 2008 00:13:00 +0200 [thread overview]
Message-ID: <20080128221300.GH8767@does.not.exist> (raw)
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
next reply other threads:[~2008-01-28 22:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-28 22:13 Adrian Bunk [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080128221300.GH8767@does.not.exist \
--to=bunk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=tobias.lorenz@gmx.net \
--cc=v4l-dvb-maintainer@linuxtv.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.