From patchwork Tue Aug 29 12:16:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 9927239 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 0056F60380 for ; Tue, 29 Aug 2017 12:17:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 012BA288C9 for ; Tue, 29 Aug 2017 12:17:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA2B8288CD; Tue, 29 Aug 2017 12:17:16 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 73BD4288C9 for ; Tue, 29 Aug 2017 12:17:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753736AbdH2MRP (ORCPT ); Tue, 29 Aug 2017 08:17:15 -0400 Received: from mail-dm3nam03on0068.outbound.protection.outlook.com ([104.47.41.68]:41312 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753323AbdH2MRM (ORCPT ); Tue, 29 Aug 2017 08:17:12 -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; bh=F9sPrWEIdHipggJkxMsZjLSiK4DydDR6fXz4wxQFzbQ=; b=BhgNkh9n2lx2tDQ1gygRen9uNqKzQ+8NuAQh6orVfh7jmu97XZpDgSv2eTH045Izad4tcOmxvQkScQNkhdmFbhKocvmJfdRKcIOcPojaadGGKRy9meHYxm02oeaHsvy+P5yp5TH8Et/mvCi/mEEav0i0/jMi37SfhOlYRUP/xDM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by BY2PR05MB1927.namprd05.prod.outlook.com (10.163.32.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.2; Tue, 29 Aug 2017 12:17:09 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil , Sergey Matyukevich Subject: [PATCH 4/5] qtnfmac: fix free_xfer_buffer cleanup Date: Tue, 29 Aug 2017 15:16:22 +0300 Message-Id: <20170829121623.24761-5-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170829121623.24761-1-sergey.matyukevich.os@quantenna.com> References: <20170829121623.24761-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: HE1PR07CA0006.eurprd07.prod.outlook.com (10.160.74.144) To BY2PR05MB1927.namprd05.prod.outlook.com (10.163.32.141) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 150fd4a9-1a9f-4c8e-4d09-08d4eed7e00b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BY2PR05MB1927; X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB1927;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9/FXTIc2Tkl8IoR6yplm7t6IdOabRJGfmq8UmrY9sU5QwgNxk087nrSuMkPC1I/FYiZ5ZQDep15EmBHFrbUcMIHVVVMpXOR37IZdp+5hWaO/Bp//OT2Cxyy0cZr5UfuUy6JTZ1vNjlfpn71hTludybsyKMqhGbYqC8RbhgoblotABSsA+Z0QGKlZu6UjByIIar5SijJAQHFZYYTsBul1IqlFIK49kdCuTuUIHJFYj721z5wk+uH0vmEuoKwlV776GLtHMAu3QYCifZhpxFzi6h8Wx5C//r6BjuaGmvrsIIxTl9YGDxgCl8jIpnbadS6MDJ1MJ3zhdOLvv96/9; 4:1niNyvCuOlSiP4MIdN5zSaPyuYiR+CFUSEd+UfZ/DY62DblfhaEcq01ykQnBEKe1phJ34eSX52oCUpayy9C+Vxv8zhbJ6j+cbCI9DuB5twqWAeM/syR2of5DY7gAdbNFD+xYsxfcGwqL0yKF+kBudQ+CimA0qfDbW6Xw4MCKZhXakXmDgAzp0WsMkBUfAfy0LLMEHeaN4PkFEhr1wY1C8SUsI+XaT1xkhd7HRGDfS0Hjw38aFECFvrID1vU4USbp X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6041248)(20161123558100)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR05MB1927; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR05MB1927; X-Forefront-PRVS: 0414DF926F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(39830400002)(189002)(199003)(2906002)(66066001)(5660300001)(6486002)(478600001)(305945005)(6116002)(3846002)(7350300001)(103116003)(33646002)(2361001)(106356001)(2351001)(105586002)(69596002)(575784001)(86362001)(42186005)(53416004)(7736002)(47776003)(6666003)(68736007)(50226002)(48376002)(50986999)(107886003)(25786009)(110136004)(76176999)(2950100002)(97736004)(6916009)(1076002)(50466002)(54906002)(36756003)(81156014)(189998001)(53936002)(101416001)(4326008)(8676002)(81166006)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR05MB1927; H:bars.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR05MB1927; 23:CXM1rmf9coGCT4P+TQZFRQM3xTQO6tWzhqug0MKxc?= =?us-ascii?Q?5j2y0Xp5hv4gvNAUiYPRe6yNIIkp1F0stmo2TbvdLaWw6I/rnuglSXwlbBoy?= =?us-ascii?Q?PWyTjX2mBUeIv9Mi5zjz9bNs7St+g/c9T9Yjwq7q0kJkjFcuHNISpwE6bmll?= =?us-ascii?Q?af1yXcmMBWmmYysuU2Mx9m/UfEUNpQXohL207DI1BDJjTFF+Xo5fZqTsWWCG?= =?us-ascii?Q?6iGHldPY6o7moB2B6Quncz+BNAX0qXv3nPMT3kcmFdEaUaAiiOFPY1fuAiIO?= =?us-ascii?Q?6Vvzm9Gx6UQAicMPptFaX/GDzSJX3alzU1BAFrG7ONoy7xP5edMdHtJBaXPZ?= =?us-ascii?Q?Doyqm4ncKTIipcubqhClnkC+oo18Ph1egIPG2AAUDAdB79wfl/S6uY3Hepz5?= =?us-ascii?Q?H9Ezr2AIysQY+AycFuxu5gAB7ElOqX7IXoZeAg6CC2pgyy8x70J0njadGfC4?= =?us-ascii?Q?KaOyX9czepEIhakvwufbwubDc/dLhWyKDKJeP2YIpk+roDlyvE+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orNc1NoJtmYiC8ptARqavY3zcbDfJ7trR0iBooPrklxEn/l0J0FuXKhPeLuXJd8MAT/MAf/nKO2vIQsHqx9A9TrOhB3XQXFvqXmSjADuNX+b2xUdl8ROFwv8VVyFVffHwiRG26Ywqq0Jk+aDc7pVH+9D6Uk2BKGxPnM/0AUxf0qsu9pDwpUtlI77r4Tfcdnh+yKT8TxVmjATthRakdCBC8cjgGkJHl56rjTNO9v/QMjqg1BchEP3lP4Tw==; 5:u3Bxwi7G7tBxVBA0LZ18UpFGh9nC+1MTURaOklSNc68vDAc1KgUbzFcBfhsUj8A6+IhdzuKIaleGfglNWc3upp/SIHCRFDlLs5aJAoD2vFuvWRUnnMRLpdZi9RXPpQ4w7GEdn44UxinouNlpCx/QJw==; 24:pDhZ/0oLap0GcrhkmhoCbCTkjkAhZfv4P5H8ym6JY4ZVegv9WvjpdHxZSE/k7Ofy1ih7oj55Li1g9Hu5M1yNKME0Pga1lMCQgWMKXkqolQc=; 7:9rJlJc4QTUdYDE8MAx2erXm6zJ2LoK8DlJjBUCzZ/3T2Ie2Yo5L9KWEhphcuTPnJ8rYjOtrJfdP849IZIxdm0FSt+YnWu07Wcl4bdCehAiI2JQ201+rtfUz06VX5Rm4xy5UpJsfGu4ilGkuLskKUKooN4y5sSFd1Ql7HPCJmH0M04+2lsb47YIH/quU80aCvPS63Yx39AsK/XSuWuxVPB/eCEvsJ47NLf7/XJgrZv10= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2017 12:17:09.7329 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR05MB1927 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 Check if skb tracking arrays has been already allocated. This additional check handles the case when init partially failed. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c index bfbcd0bf75bf..2921d8069bf2 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c +++ b/drivers/net/wireless/quantenna/qtnfmac/pearl/pcie.c @@ -483,7 +483,7 @@ static void free_xfer_buffers(void *data) /* free rx buffers */ for (i = 0; i < priv->rx_bd_num; i++) { - if (priv->rx_skb[i]) { + if (priv->rx_skb && priv->rx_skb[i]) { rxbd = &priv->rx_bd_vbase[i]; paddr = QTN_HOST_ADDR(le32_to_cpu(rxbd->addr_h), le32_to_cpu(rxbd->addr)); @@ -496,7 +496,7 @@ static void free_xfer_buffers(void *data) /* free tx buffers */ for (i = 0; i < priv->tx_bd_num; i++) { - if (priv->tx_skb[i]) { + if (priv->tx_skb && priv->tx_skb[i]) { dev_kfree_skb_any(priv->tx_skb[i]); priv->tx_skb[i] = NULL; }