diff options
author | Antti Palosaari <crope@iki.fi> | 2014-04-05 16:23:43 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-04-06 10:08:19 -0400 |
commit | cf2a320e1f61fe685757072dc75db0853b884e0b (patch) | |
tree | 6aa02abe81e3f25d3af655a5680289bdcbe5f4a2 | |
parent | 11da6ed6914de0953c14f5e7ff93dc8dab45adc7 (diff) |
[media] msi3101: check I/O return values on stop streaming
Coverity CID 1196496: Unchecked return value (CHECKED_RETURN)
Calling "msi3101_ctrl_msg" without checking return value (as is done
elsewhere 8 out of 10 times).
Reported-by: <scan-admin@coverity.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/staging/media/msi3101/sdr-msi3101.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/staging/media/msi3101/sdr-msi3101.c b/drivers/staging/media/msi3101/sdr-msi3101.c index f8d5ee4b580a..65d351f99da2 100644 --- a/drivers/staging/media/msi3101/sdr-msi3101.c +++ b/drivers/staging/media/msi3101/sdr-msi3101.c | |||
@@ -1077,6 +1077,7 @@ static int msi3101_start_streaming(struct vb2_queue *vq, unsigned int count) | |||
1077 | static int msi3101_stop_streaming(struct vb2_queue *vq) | 1077 | static int msi3101_stop_streaming(struct vb2_queue *vq) |
1078 | { | 1078 | { |
1079 | struct msi3101_state *s = vb2_get_drv_priv(vq); | 1079 | struct msi3101_state *s = vb2_get_drv_priv(vq); |
1080 | int ret; | ||
1080 | dev_dbg(&s->udev->dev, "%s:\n", __func__); | 1081 | dev_dbg(&s->udev->dev, "%s:\n", __func__); |
1081 | 1082 | ||
1082 | if (mutex_lock_interruptible(&s->v4l2_lock)) | 1083 | if (mutex_lock_interruptible(&s->v4l2_lock)) |
@@ -1089,17 +1090,22 @@ static int msi3101_stop_streaming(struct vb2_queue *vq) | |||
1089 | 1090 | ||
1090 | /* according to tests, at least 700us delay is required */ | 1091 | /* according to tests, at least 700us delay is required */ |
1091 | msleep(20); | 1092 | msleep(20); |
1092 | msi3101_ctrl_msg(s, CMD_STOP_STREAMING, 0); | 1093 | ret = msi3101_ctrl_msg(s, CMD_STOP_STREAMING, 0); |
1094 | if (ret) | ||
1095 | goto err_sleep_tuner; | ||
1093 | 1096 | ||
1094 | /* sleep USB IF / ADC */ | 1097 | /* sleep USB IF / ADC */ |
1095 | msi3101_ctrl_msg(s, CMD_WREG, 0x01000003); | 1098 | ret = msi3101_ctrl_msg(s, CMD_WREG, 0x01000003); |
1099 | if (ret) | ||
1100 | goto err_sleep_tuner; | ||
1096 | 1101 | ||
1102 | err_sleep_tuner: | ||
1097 | /* sleep tuner */ | 1103 | /* sleep tuner */ |
1098 | v4l2_subdev_call(s->v4l2_subdev, core, s_power, 0); | 1104 | ret = v4l2_subdev_call(s->v4l2_subdev, core, s_power, 0); |
1099 | 1105 | ||
1100 | mutex_unlock(&s->v4l2_lock); | 1106 | mutex_unlock(&s->v4l2_lock); |
1101 | 1107 | ||
1102 | return 0; | 1108 | return ret; |
1103 | } | 1109 | } |
1104 | 1110 | ||
1105 | static struct vb2_ops msi3101_vb2_ops = { | 1111 | static struct vb2_ops msi3101_vb2_ops = { |