Skip to contentSkip to conversation

mwifiex: do not return success when command times out

PATCH Applied Dmitry Torokhov 2 participants 2 messages Apr 30, 2015 – May 9, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mwifiex: do not return success when command times out

wait_event_interruptible_timeout() returns 0 upon timeout. We should convert it to a negative error code (such as -ETIMEDOUT) instead of returning it directly, as return code of 0 indicates that command was executed.

---
 drivers/net/wireless/mwifiex/sta_ioctl.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/mwifiex/sta_ioctl.c +2 -0
index 0599e41..a0bc26c 100644
@@ -64,6 +64,8 @@ int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter,
 						  *(cmd_queued->condition),
 						  (12 * HZ));
 	if (status <= 0) {
+		if (status == 0)
+			status = -ETIMEDOUT;
 		dev_err(adapter->dev, "cmd_wait_q terminated: %d\n", status);
 		mwifiex_cancel_all_pending_cmd(adapter);
 		return status;
Signature · 5 lines
2.2.0.rc0.207.ga3a616c


-- 
Dmitry
Applied
#1 lore raw
Quoted 7 lines

wait_event_interruptible_timeout() returns 0 upon timeout. We should convert it to a negative error code (such as -ETIMEDOUT) instead of returning it directly, as return code of 0 indicates that command was executed.

Thanks, applied to wireless-drivers-next.git.

Kalle Valo