[media] pvrusb2-io: no need to check if sp is not NULL
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 22 Feb 2016 16:02:36 +0000 (13:02 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 23 Feb 2016 10:20:07 +0000 (07:20 -0300)
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

index d860344de84e84dec5b7977cdc8ee0ed8288aca7..e68ce24f27e3df8a197719afac678a3121e75930 100644 (file)
@@ -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);
        }
 }
This page took 0.02502 seconds and 5 git commands to generate.