All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: unlisted-recipients:; (no To-header on input)@casper.infradead.org
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Mike Isely <isely@pobox.com>
Subject: [PATCH 1/9] [media] pvrusb2-io: no need to check if sp is not NULL
Date: Mon, 22 Feb 2016 16:09:15 -0300	[thread overview]
Message-ID: <4340d9c3cc750cc30918b5de6bf16de2722f7d1b.1456167652.git.mchehab@osg.samsung.com> (raw)

The buffer_complete() routine assumes that sp is not NULL,
otherwise it will fail completely. Btw, this is also
assumed at pvr2_buffer_queue(), with is the routine that
setups the URB handling.

So, remove the bogus for the callback at buffer_complete.

This fix this smatch warning:
	drivers/media/usb/pvrusb2/pvrusb2-io.c:476 buffer_complete() warn: variable dereferenced before check 'sp' (see line 472)

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
---
 drivers/media/usb/pvrusb2/pvrusb2-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/pvrusb2/pvrusb2-io.c b/drivers/media/usb/pvrusb2/pvrusb2-io.c
index d860344de84e..e68ce24f27e3 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-io.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-io.c
@@ -473,7 +473,7 @@ static void buffer_complete(struct urb *urb)
 	}
 	spin_unlock_irqrestore(&sp->list_lock,irq_flags);
 	pvr2_buffer_set_ready(bp);
-	if (sp && sp->callback_func) {
+	if (sp->callback_func) {
 		sp->callback_func(sp->callback_data);
 	}
 }
-- 
2.5.0


             reply	other threads:[~2016-02-22 19:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-22 19:09 Mauro Carvalho Chehab [this message]
2016-02-22 19:09 ` [PATCH 2/9] [media] pvrusb2: don't go past buf array Mauro Carvalho Chehab
2016-02-22 19:09 ` [PATCH 3/9] [media] stv0900: avoid going past array Mauro Carvalho Chehab
2016-02-22 20:36   ` Michael Ira Krufky
2016-02-22 19:09 ` [PATCH 4/9] [media] ivtv: steal could be NULL Mauro Carvalho Chehab
2016-02-22 19:09 ` [PATCH 5/9] [media] dib9000: read16/write16 could return an error code Mauro Carvalho Chehab
2016-02-22 20:48   ` Michael Ira Krufky
2016-02-22 19:09 ` [PATCH 6/9] [media] drxj: set_param_parameters array is too short Mauro Carvalho Chehab
2016-02-22 19:09 ` [PATCH 7/9] [media] av7110: remove a bogus smatch warning Mauro Carvalho Chehab
2016-02-22 19:09 ` [PATCH 8/9] [media] ttpci: cleanup " Mauro Carvalho Chehab
2016-02-22 19:09 ` [PATCH 9/9] ivtv-mailbox: avoid confusing smatch Mauro Carvalho Chehab
2016-02-22 20:22   ` Andy Walls

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=4340d9c3cc750cc30918b5de6bf16de2722f7d1b.1456167652.git.mchehab@osg.samsung.com \
    --to=mchehab@osg.samsung.com \
    --cc=isely@pobox.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.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.