Commit 62220293 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[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: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 86b2749b
...@@ -3672,11 +3672,10 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw, ...@@ -3672,11 +3672,10 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
hdw->cmd_debug_state = 1; hdw->cmd_debug_state = 1;
if (write_len) { if (write_len && write_data)
hdw->cmd_debug_code = ((unsigned char *)write_data)[0]; hdw->cmd_debug_code = ((unsigned char *)write_data)[0];
} else { else
hdw->cmd_debug_code = 0; hdw->cmd_debug_code = 0;
}
hdw->cmd_debug_write_len = write_len; hdw->cmd_debug_write_len = write_len;
hdw->cmd_debug_read_len = read_len; hdw->cmd_debug_read_len = read_len;
...@@ -3688,7 +3687,7 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw, ...@@ -3688,7 +3687,7 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
setup_timer(&timer, pvr2_ctl_timeout, (unsigned long)hdw); setup_timer(&timer, pvr2_ctl_timeout, (unsigned long)hdw);
timer.expires = jiffies + timeout; timer.expires = jiffies + timeout;
if (write_len) { if (write_len && write_data) {
hdw->cmd_debug_state = 2; hdw->cmd_debug_state = 2;
/* Transfer write data to internal buffer */ /* Transfer write data to internal buffer */
for (idx = 0; idx < write_len; idx++) { for (idx = 0; idx < write_len; idx++) {
...@@ -3795,7 +3794,7 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw, ...@@ -3795,7 +3794,7 @@ static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
goto done; goto done;
} }
} }
if (read_len) { if (read_len && read_data) {
/* Validate results of read request */ /* Validate results of read request */
if ((hdw->ctl_read_urb->status != 0) && if ((hdw->ctl_read_urb->status != 0) &&
(hdw->ctl_read_urb->status != -ENOENT) && (hdw->ctl_read_urb->status != -ENOENT) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment