[1/9,media] pvrusb2-io: no need to check if sp is not NULL
diff mbox

Message ID 4340d9c3cc750cc30918b5de6bf16de2722f7d1b.1456167652.git.mchehab@osg.samsung.com
State New
Headers show

Commit Message

Mauro Carvalho Chehab Feb. 22, 2016, 7:09 p.m. UTC
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 mbox

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)
-	if (sp && sp->callback_func) {
+	if (sp->callback_func) {