media/ov511: cleanup: remove unneeded null check

Message ID 20100505055948.GE27064@bicker (mailing list archive)
State Superseded, archived
Headers

Commit Message

Dan Carpenter May 5, 2010, 5:59 a.m. UTC
  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>

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  

Patch

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;