From patchwork Tue May 29 12:00:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10435117 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E4B26602CC for ; Tue, 29 May 2018 12:01:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4FF628724 for ; Tue, 29 May 2018 12:01:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9A8828733; Tue, 29 May 2018 12:01:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A41728724 for ; Tue, 29 May 2018 12:01:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933565AbeE2MBF (ORCPT ); Tue, 29 May 2018 08:01:05 -0400 Received: from mail-by2nam03on0088.outbound.protection.outlook.com ([104.47.42.88]:23410 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933561AbeE2MAg (ORCPT ); Tue, 29 May 2018 08:00:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tUE6PyhULj3R7hWITl7XS9Ld9SoAB62prNmn/WDH1vI=; b=qtTtu/k1fGI1uefWHKd7YjO3kZygaeZzs7EFmKIPt4c5F94GN3GIbQbD8WewSI0HOT4ZhUXNij1BNPsgiN+Pze/SVFBfGQ0MMK285TId3xeJp2OW97T2hpSS69oLLEOO2gn6zFAY7qzwGFEyWeTNXjz1t0dBUTUnsrjfGTbi3Os= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by BLUPR05MB1923.namprd05.prod.outlook.com (2a01:111:e400:52ad::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.5; Tue, 29 May 2018 12:00:28 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Andrey Shevchenko , Sergei Maksimenko , Dmitry Lebed Subject: [PATCH 6/9] qtnfmac: fix firmware command error path Date: Tue, 29 May 2018 15:00:02 +0300 Message-Id: <20180529120005.21498-7-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180529120005.21498-1-sergey.matyukevich.os@quantenna.com> References: <20180529120005.21498-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: AM6PR03CA0031.eurprd03.prod.outlook.com (2603:10a6:20b::44) To BLUPR05MB1923.namprd05.prod.outlook.com (2a01:111:e400:52ad::13) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BLUPR05MB1923; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB1923; 3:3LiNHkg4xX8I8WTkSjRkkQMdce5eN5DXYBs07f6ZSlwrzX1/FXHpOh9ulUTNJi9K+DSniJ13PYjJvPKCE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qP7VKBfB/ThpvqenN8I4nMH9d2b1QOsAwcScOl3J9+gKonaEZ92DwEL8RUSHUmOjOCgadELKZdYmu+HeVmC/UaNe8DJGSXS41qLMwTMIbQYGfw6nfYIuhMLjG93LlZVs90qG2INTQ29rVz0a3c8igsInGV/15S+s8jesa/XZzGnL+wtzYGBDtphHrQLYblILaB8gTQrCLQPX1dTNLT5iQ8p+69SV227oGRN3qW+8eqXiU7DJQIxRBwix6ySynmXcAjgJXUuwrvof8Y2Uj2iHvkx97sCYA; 4:MSVXBccH/TOUb1UADzOR/Y4k/Q31H3mtNVOO7N2sjae7wzmG1rSmGBOK/M4jQbkbbBvMOlA6j9Ic96RI221wG2KCbM3wphQGKLYtY3mlyHCqWt+7MMtuRBXTP4Pp1lz/g6q84SN11lhbUY3gySj4MbEUeMLzafVzDQaGvTBWwZ+J3b9U7vOf3exWyc0llXrr2168F/C4keP2hdWa1WgsDmltXi6OlSxwZ7eaOdMh2lL4+XjqJmqZl8ENywDlnmYjZ5CRzx/js50rzKA5zSH7Zg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231254)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:BLUPR05MB1923; BCL:0; PCL:0; RULEID:; SRVR:BLUPR05MB1923; X-Forefront-PRVS: 0687389FB0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39840400004)(396003)(366004)(39380400002)(376002)(346002)(199004)(189003)(2361001)(2616005)(11346002)(51416003)(956004)(50466002)(107886003)(50226002)(48376002)(97736004)(446003)(478600001)(2906002)(476003)(86362001)(106356001)(81166006)(76176011)(66066001)(105586002)(3846002)(47776003)(6116002)(7696005)(486006)(81156014)(316002)(186003)(1076002)(53416004)(36756003)(25786009)(26005)(16526019)(103116003)(68736007)(54906003)(52116002)(6916009)(5660300001)(7736002)(69596002)(6666003)(305945005)(8676002)(16586007)(59450400001)(4326008)(386003)(2351001)(53936002)(8936002)(6486002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR05MB1923; H:bars.quantenna.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR05MB1923; 23:uDLsSLj2Uk3u4WPuofhH3lL80rUZEeyX+Ph5euaC8?= =?us-ascii?Q?1VkrKFJ4CfbrFU6W6orwFCj4m7zpfj6YBjE0nfKaOa2NTHvDe74pm2fiK8hl?= =?us-ascii?Q?+15BKbtEqY6rfHWMk8VFcrbq6FRHxRhnh40dTS6u4gsYjiagcYiY07c4IihR?= =?us-ascii?Q?tyYeqDi+7gQs5BK/UjramvjJGfDu0Zy+46FlpAjrtVYg6vxZG4myttLAThHu?= =?us-ascii?Q?9YQSxx7ggLIoB6YlUW1PqV0hDIqStb9f5xy/ctUJj+BKRr9mVPGL6WuQiPCX?= =?us-ascii?Q?hsWAglRG4IJ68fK3TOOsn48LuI++3TpjYRlWtU2VrcP/KVu2S+K0CvWoEYo0?= =?us-ascii?Q?EgeKeK97zr9cgALto7OA0GqgYYfzPlNh037kivTwxkSsUnNi8k9XQX3hZze+?= =?us-ascii?Q?ZB20dB9DGi/OTpTLNN5ieftej6yysgI5IjpfiQ+7A2gcd89jIO2TJ3uHGl+H?= =?us-ascii?Q?rTZlQ5FvuXJXLkkxnY+LhSdonTZ7brw3x70Ha5DvLgle672r6BPcdkn2hxqD?= =?us-ascii?Q?7A6R0+jct/w8B9wz+J5h1j5Ww+4Nr3VRBN/NLQJ8vFsNoUZiXnAjdOhqG6y1?= =?us-ascii?Q?1AA9C1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fICp1oXrgNBn+n0M2G20C+oISJ4sVYqLgMk0N0Qz5jJNjeIOqA1bGhwvIIjAQR1YHvLV85K3PoOPQCCMeWGHo9U928cdiiECuP X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB1923; 6:H4YQV7KtFru9re7xwDvLb38vF3E1v711VAD4LSrps5iR2+UIyvdnoIEyQqTgvxukWyVOfKevQ3mHsFtrCq7lcHOxs6aHYR+sPejrmmapnO4KWwfBffo5skG55tVkHHQPo0aOYYd8DbQGh+90C5LuQXzXyy6K0ObNzK261Q1Qjkbn6qdwDBlJz5lrEOqlNxqIPYmMY05OL2NYnUH/CDgx90XYyfTDSPbOMjJv/HU/UqZiYhxdCnZPhPfwPkHohuH0yyxeT5a2PHuhnTovkA2d0IQHccuNkj+FOqGbIBbbKVQ05RN+QDXBMFe//rzd77W31LNSwhLS8hg/5fHH6hQLuTwvynOao21lvlEzrmcrYHBJV02S6lA5leKxp4qoEBvQvPOAmBuKzGuqG3aj8LjgX/p2ZAjCZUFetIlIoc0icT63mD/heqFLscXNZjXyabdZ4mjomE8eYYtOwW0vl5tf6w==; 5:v/eEc5DBXsHdxni5GFqdqhc3khudi5ff7ywAKyUz4t4xxitNbzciViY2r1sOiCm2QGhLSjGkDp3pJRPPGTE9xBy7Ko745Wv+sQGJE7pyvFvNAPcz0lAJtZaKzlZgGehp50/M2cda5bdprcN7jGUEHTdlQQzlUGXYWR2wslcT3PQ=; 24:V9LBl+Fk5r8vq8s3CD0sD2tJYknTfr4YuFLfslljxYyK8q7VXbfC7C7oNbgjAG+NzLt+ZbdgPjo6g+rJqJnDlqPm3ekIDsnEnHHZiLxaBv0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB1923; 7:/rDannzLpKblsf+/dv5frwgnfp/wtxfkJNdqnPxgK1EpfYfPTe/EWg57QF0Q2iVnMYNCgHYL33sSGJRmdgFW3bKLKQIdA7lfNx99uQCwHHxZvi50sw65c9ecAaFJWNGqlLbB8YNfMenhmlKZLsl5DMti4rp9NjLu9isrtepiXGpuspAaNcb14RSJzcK0ETII1qCd9zZ3ZjAtyYuPBTQHfeTUGp4vP9VbOuzP1s2c24vVbKpoGjL2piZbLpGmxXni X-MS-Office365-Filtering-Correlation-Id: 0cad73b1-35f7-40a2-08a3-08d5c55bc60e X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2018 12:00:28.8488 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0cad73b1-35f7-40a2-08a3-08d5c55bc60e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB1923 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dmitry Lebed Free command skb if bus state is not QTNF_FW_STATE_ACTIVE. Signed-off-by: Dmitry Lebed --- drivers/net/wireless/quantenna/qtnfmac/commands.c | 1 + drivers/net/wireless/quantenna/qtnfmac/trans.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 9dc4560be5d8..e2fc57be1cdd 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -102,6 +102,7 @@ static int qtnf_cmd_send_with_reply(struct qtnf_bus *bus, pr_warn("VIF%u.%u: drop cmd 0x%.4X in fw state %d\n", mac_id, vif_id, le16_to_cpu(cmd->cmd_id), bus->fw_state); + dev_kfree_skb(cmd_skb); return -ENODEV; } diff --git a/drivers/net/wireless/quantenna/qtnfmac/trans.c b/drivers/net/wireless/quantenna/qtnfmac/trans.c index ccddfebc508a..345f34ec9750 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/trans.c +++ b/drivers/net/wireless/quantenna/qtnfmac/trans.c @@ -35,8 +35,10 @@ int qtnf_trans_send_cmd_with_resp(struct qtnf_bus *bus, struct sk_buff *cmd_skb, bool resp_not_handled = true; struct sk_buff *resp_skb = NULL; - if (unlikely(!response_skb)) + if (unlikely(!response_skb)) { + dev_kfree_skb(cmd_skb); return -EFAULT; + } spin_lock(&ctl_node->resp_lock); ctl_node->seq_num++;