提交 cf4b4aab 编写于 作者: H Henrique de Moraes Holschuh 提交者: John W. Linville

rfkill: use killable locks instead of interruptible

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: NHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 e8975581
...@@ -431,8 +431,9 @@ static ssize_t rfkill_state_store(struct device *dev, ...@@ -431,8 +431,9 @@ static ssize_t rfkill_state_store(struct device *dev,
state != RFKILL_STATE_SOFT_BLOCKED) state != RFKILL_STATE_SOFT_BLOCKED)
return -EINVAL; return -EINVAL;
if (mutex_lock_interruptible(&rfkill->mutex)) error = mutex_lock_killable(&rfkill->mutex);
return -ERESTARTSYS; if (error)
return error;
error = rfkill_toggle_radio(rfkill, state, 0); error = rfkill_toggle_radio(rfkill, state, 0);
mutex_unlock(&rfkill->mutex); mutex_unlock(&rfkill->mutex);
...@@ -472,7 +473,7 @@ static ssize_t rfkill_claim_store(struct device *dev, ...@@ -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 * Take the global lock to make sure the kernel is not in
* the middle of rfkill_switch_all * the middle of rfkill_switch_all
*/ */
error = mutex_lock_interruptible(&rfkill_global_mutex); error = mutex_lock_killable(&rfkill_global_mutex);
if (error) if (error)
return error; return error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册