Skip to content

Commit

Permalink
[media] dib0700: do not lock interruptible on tear-down paths
Browse files Browse the repository at this point in the history
When mutex_lock_interruptible is used on paths where a signal can be
pending, the device is not closed properly and cannot be reused.
This usually happens when you start tzap for example and send it a
TERM signal. The signal is pending while tear-down routines are
called. Hence streaming is not properly stopped in that case. And
the device stops working from that moment on.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Jiri Slaby authored and Mauro Carvalho Chehab committed Jan 6, 2013
1 parent 1c612e9 commit a96fbe0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/media/usb/dvb-usb/dib0700_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,7 @@ int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
}
}

if (mutex_lock_interruptible(&adap->dev->usb_mutex) < 0) {
err("could not acquire lock");
return -EINTR;
}
mutex_lock(&adap->dev->usb_mutex);

st->buf[0] = REQUEST_ENABLE_VIDEO;
/* this bit gives a kind of command,
Expand Down

0 comments on commit a96fbe0

Please sign in to comment.