summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2016-07-16 13:58:31 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-07-19 19:21:34 +0300
commite883b4d02670ae83ab24e9af969de1af756959f8 (patch)
tree2efb905cd39b30680d05cb2aeec230400bbf8938 /drivers/staging
parente05b1872f29a85532c2b34e3a4974a27158f1463 (diff)
downloadlinux-e883b4d02670ae83ab24e9af969de1af756959f8.tar.xz
[media] cec: CEC_RECEIVE overwrote the timeout field
When CEC_RECEIVE returns a message the original timeout field was overwritten. Restore the timeout field. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/media/cec/cec-api.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/media/cec/cec-api.c b/drivers/staging/media/cec/cec-api.c
index 9151b1fa18dc..879f7d96e1a7 100644
--- a/drivers/staging/media/cec/cec-api.c
+++ b/drivers/staging/media/cec/cec-api.c
@@ -209,6 +209,7 @@ static long cec_transmit(struct cec_adapter *adap, struct cec_fh *fh,
/* Called by CEC_RECEIVE: wait for a message to arrive */
static int cec_receive_msg(struct cec_fh *fh, struct cec_msg *msg, bool block)
{
+ u32 timeout = msg->timeout;
int res;
do {
@@ -225,6 +226,8 @@ static int cec_receive_msg(struct cec_fh *fh, struct cec_msg *msg, bool block)
kfree(entry);
fh->queued_msgs--;
mutex_unlock(&fh->lock);
+ /* restore original timeout value */
+ msg->timeout = timeout;
return 0;
}