aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2016-04-15 11:35:32 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-04-20 14:48:29 -0400
commit622202938952e43471c31835906c8a4f4e16f050 (patch)
treeda87525da8ce416765ad1350070394699b2f1114
parent86b2749ba79e78130dd9f678aa52d57992fbdf1c (diff)
[media] pvrusb2: fix smatch errors
These are false positives, but still easy to fix. pvrusb2-hdw.c:3676 pvr2_send_request_ex() error: we previously assumed 'write_data' could be null (see line 3648) pvrusb2-hdw.c:3829 pvr2_send_request_ex() error: we previously assumed 'read_data' could be null (see line 3649) Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-hdw.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
index 1a093e5953fd..83e9a3eb3859 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
@@ -3672,11 +3672,10 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
3672 3672
3673 3673
3674 hdw->cmd_debug_state = 1; 3674 hdw->cmd_debug_state = 1;
3675 if (write_len) { 3675 if (write_len && write_data)
3676 hdw->cmd_debug_code = ((unsigned char *)write_data)[0]; 3676 hdw->cmd_debug_code = ((unsigned char *)write_data)[0];
3677 } else { 3677 else
3678 hdw->cmd_debug_code = 0; 3678 hdw->cmd_debug_code = 0;
3679 }
3680 hdw->cmd_debug_write_len = write_len; 3679 hdw->cmd_debug_write_len = write_len;
3681 hdw->cmd_debug_read_len = read_len; 3680 hdw->cmd_debug_read_len = read_len;
3682 3681
@@ -3688,7 +3687,7 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
3688 setup_timer(&timer, pvr2_ctl_timeout, (unsigned long)hdw); 3687 setup_timer(&timer, pvr2_ctl_timeout, (unsigned long)hdw);
3689 timer.expires = jiffies + timeout; 3688 timer.expires = jiffies + timeout;
3690 3689
3691 if (write_len) { 3690 if (write_len && write_data) {
3692 hdw->cmd_debug_state = 2; 3691 hdw->cmd_debug_state = 2;
3693 /* Transfer write data to internal buffer */ 3692 /* Transfer write data to internal buffer */
3694 for (idx = 0; idx < write_len; idx++) { 3693 for (idx = 0; idx < write_len; idx++) {
@@ -3795,7 +3794,7 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
3795 goto done; 3794 goto done;
3796 } 3795 }
3797 } 3796 }
3798 if (read_len) { 3797 if (read_len && read_data) {
3799 /* Validate results of read request */ 3798 /* Validate results of read request */
3800 if ((hdw->ctl_read_urb->status != 0) && 3799 if ((hdw->ctl_read_urb->status != 0) &&
3801 (hdw->ctl_read_urb->status != -ENOENT) && 3800 (hdw->ctl_read_urb->status != -ENOENT) &&