public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] media/ov511: cleanup: remove unneeded null check
@ 2010-05-05  5:59 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-05-05  5:59 UTC (permalink / raw)
  To: linux-media; +Cc: Mauro Carvalho Chehab

We dereference "ov" unconditionally throughout the function so there is
no way it can be NULL here.  This code has been around for ages so if 
it were possible for "ov" to be NULL someone would have complained.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c
index 6085d55..a109120 100644
--- a/drivers/media/video/ov511.c
+++ b/drivers/media/video/ov511.c
@@ -5940,7 +5940,7 @@ ov51x_disconnect(struct usb_interface *intf)
 	ov->dev = NULL;
 
 	/* Free the memory */
-	if (ov && !ov->user) {
+	if (!ov->user) {
 		mutex_lock(&ov->cbuf_lock);
 		kfree(ov->cbuf);
 		ov->cbuf = NULL;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-05  6:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-05  5:59 [patch] media/ov511: cleanup: remove unneeded null check Dan Carpenter

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