From patchwork Thu Apr 30 23:52:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 6307611 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D495FBEEE1 for ; Thu, 30 Apr 2015 23:52:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 090D6201C0 for ; Thu, 30 Apr 2015 23:52:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1C26C20131 for ; Thu, 30 Apr 2015 23:52:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751270AbbD3XwK (ORCPT ); Thu, 30 Apr 2015 19:52:10 -0400 Received: from mail-ie0-f177.google.com ([209.85.223.177]:34098 "EHLO mail-ie0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751077AbbD3XwI (ORCPT ); Thu, 30 Apr 2015 19:52:08 -0400 Received: by iedfl3 with SMTP id fl3so89899626ied.1; Thu, 30 Apr 2015 16:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=gvq7goFh4SG7p+9aUkoLE3TMkrLY65GFC30vMAuS53A=; b=kC0yZ9pP21R9dOi+5UebKC7ape9ekyR8rJ0HLgICsrjwvACLd4tOLGYfpdNu5sYsN/ pi2Xp16M0oESyCDM8vWkC7xgGDri2+7LIoFrKeL117Ru+mPr54oDIxXtd4+qXqJUnFIb kOXe8rkKYqXAWp3XRB1xdtsaJxWtrx7PZtShta8k2KWzcCn1XvQhhK4LRNICoA9P7iHF XWDTLCUNbUek4UINC5TT99raYgCGGxqLHeKXZU020S3poF36T9WnZd4CqQcWT/s9VBN1 jXd4AdL0zqADSrlCaeDwa0mCFwmpBEsWCXJJ6eRn68p0KtFbXPjncZSJK9XxMA1Ly7xL 1stw== X-Received: by 10.50.66.230 with SMTP id i6mr7125614igt.22.1430437927018; Thu, 30 Apr 2015 16:52:07 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1301:743b:1112:5f81:625e]) by mx.google.com with ESMTPSA id j2sm2476629ioi.8.2015.04.30.16.52.04 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 30 Apr 2015 16:52:05 -0700 (PDT) Date: Thu, 30 Apr 2015 16:52:02 -0700 From: Dmitry Torokhov To: Amitkumar Karwar Cc: Avinash Patil , "John W. Linville" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mwifiex: do not return success when command times out Message-ID: <20150430235202.GA35256@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;