* [PATCH] mwifiex: do not return success when command times out
@ 2015-04-30 23:52 Dmitry Torokhov
2015-05-09 13:47 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Torokhov @ 2015-04-30 23:52 UTC (permalink / raw)
To: Amitkumar Karwar
Cc: Avinash Patil, John W. Linville, linux-wireless, netdev, linux-kernel
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.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/net/wireless/mwifiex/sta_ioctl.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 0599e41..a0bc26c 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -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;
--
2.2.0.rc0.207.ga3a616c
--
Dmitry
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: mwifiex: do not return success when command times out
2015-04-30 23:52 [PATCH] mwifiex: do not return success when command times out Dmitry Torokhov
@ 2015-05-09 13:47 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2015-05-09 13:47 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Amitkumar Karwar, Avinash Patil, John W. Linville,
linux-wireless, netdev, linux-kernel
> 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.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Thanks, applied to wireless-drivers-next.git.
Kalle Valo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-09 13:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-30 23:52 [PATCH] mwifiex: do not return success when command times out Dmitry Torokhov
2015-05-09 13:47 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).