/* 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 {
kfree(entry);
fh->queued_msgs--;
mutex_unlock(&fh->lock);
+ /* restore original timeout value */
+ msg->timeout = timeout;
return 0;
}
if (copy_from_user(&msg, parg, sizeof(msg)))
return -EFAULT;
mutex_lock(&adap->lock);
- if (!adap->is_configured)
+ if (!adap->is_configured && fh->mode_follower < CEC_MODE_MONITOR)
err = -ENONET;
mutex_unlock(&adap->lock);
if (err)