Skip to content

Commit

Permalink
rfkill: use killable locks instead of interruptible
Browse files Browse the repository at this point in the history
Apparently, many applications don't expect to get EAGAIN from fd read/write
operations, since POSIX doesn't mandate it.

Use mutex_lock_killable instead of mutex_lock_interruptible, which won't
cause issues.

Signed-off-by: Henrique de Moraes Holschuh <[email protected]>
Cc: Ivo van Doorn <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
hmh authored and linvjw committed Oct 31, 2008
1 parent e897558 commit cf4b4aa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions net/rfkill/rfkill.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,9 @@ static ssize_t rfkill_state_store(struct device *dev,
state != RFKILL_STATE_SOFT_BLOCKED)
return -EINVAL;

if (mutex_lock_interruptible(&rfkill->mutex))
return -ERESTARTSYS;
error = mutex_lock_killable(&rfkill->mutex);
if (error)
return error;
error = rfkill_toggle_radio(rfkill, state, 0);
mutex_unlock(&rfkill->mutex);

Expand Down Expand Up @@ -472,7 +473,7 @@ static ssize_t rfkill_claim_store(struct device *dev,
* Take the global lock to make sure the kernel is not in
* the middle of rfkill_switch_all
*/
error = mutex_lock_interruptible(&rfkill_global_mutex);
error = mutex_lock_killable(&rfkill_global_mutex);
if (error)
return error;

Expand Down

0 comments on commit cf4b4aa

Please sign in to comment.