From patchwork Sun Jan 10 02:19:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 7993941 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 BCC00BEEE5 for ; Sun, 10 Jan 2016 02:20:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E58B720259 for ; Sun, 10 Jan 2016 02:20:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 13C9720204 for ; Sun, 10 Jan 2016 02:20:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756777AbcAJCT5 (ORCPT ); Sat, 9 Jan 2016 21:19:57 -0500 Received: from m12-16.163.com ([220.181.12.16]:44639 "EHLO m12-16.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756634AbcAJCT0 (ORCPT ); Sat, 9 Jan 2016 21:19:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=4OJd13stwla42+DSVw GCA7iP9MzR44G1O8+GfNwgAbo=; b=Ddp4h3DMQP4PgpboNqifH1UHLZiE5JO1Bv ljtC4jsQHqGruyvx/FAcJ5CoGQAY6B8jwvNUNyJGtXAsjRv9bbMEI59zWv4M08z9 szuT00iUoxQbqxfzVjViq75G351eKKerCHaUuoPdIm7yyl60xmJswJL5VwTyWBpR 6NlVddUFE= Received: from bai-oslab.tsinghua.edu.cn (unknown [166.111.70.16]) by smtp12 (Coremail) with SMTP id EMCowECJoEOZv5FW3kU7AA--.16006S2; Sun, 10 Jan 2016 10:19:08 +0800 (CST) From: Jia-Ju Bai To: sgruszka@redhat.com, kvalo@codeaurora.org, johannes.berg@intel.com, emmanuel.grumbach@intel.com Cc: ilw@linux.intel.com, linuxwifi@intel.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] iwl4965: Fix a memory leak in error handling code of __il4965_up Date: Sun, 10 Jan 2016 10:19:23 +0800 Message-Id: <1452392363-3600-1-git-send-email-baijiaju1990@163.com> X-Mailer: git-send-email 1.7.9.5 X-CM-TRANSID: EMCowECJoEOZv5FW3kU7AA--.16006S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Xr1fCF1kGF48tF15WFyDJrb_yoWfZrc_G3 4IgFn29ryFkr4093W29FsxAryay3y3XFnYka9rta4Yv345JrW5AF909rZ3Z39rWr4fZa43 GrnxXFW8Jw1FqjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUjpBT7UUUUU== X-Originating-IP: [166.111.70.16] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/xtbBRRzrelO-zitN9QAAs5 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_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, 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 When il4965_hw_nic_init in __il4965_up fails, the memory allocated by iwl4965_sta_alloc_lq in iwl4965_alloc_bcast_station is not freed. This patches adds il_dealloc_bcast_stations in the error handling code of __il4965_up to fix this problem. This patch has been tested in real device, and it actually fixes the bug. Signed-off-by: Jia-Ju Bai --- drivers/net/wireless/iwlegacy/4965-mac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c index 6656215..fd7b5c7 100644 --- a/drivers/net/wireless/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/iwlegacy/4965-mac.c @@ -5577,6 +5577,7 @@ __il4965_up(struct il_priv *il) ret = il4965_hw_nic_init(il); if (ret) { IL_ERR("Unable to init nic\n"); + il_dealloc_bcast_stations(il); return ret; } From patchwork Mon Jan 11 03:37:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 7998941 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 74BFC9F1CC for ; Mon, 11 Jan 2016 03:38:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B20702024C for ; Mon, 11 Jan 2016 03:38:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD4DA20220 for ; Mon, 11 Jan 2016 03:38:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758054AbcAKDiM (ORCPT ); Sun, 10 Jan 2016 22:38:12 -0500 Received: from m12-12.163.com ([220.181.12.12]:54543 "EHLO m12-12.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758005AbcAKDiK (ORCPT ); Sun, 10 Jan 2016 22:38:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=8GA+z2TZk6IfcFQcgZ lqSb1DQyY29tPEUUe0ZGfceJM=; b=ABHJq6T/hi0ZbnzlFkCn0om/nBOHFkFRaI Mg+EBbQu1bYGr/WaueaVyVM987xBvvtrn88L+bl8jUJ/qJlySrnmptdp6twtjLsR 5vsodFDxpz8v19P8WnJSsG+ywmfHoqEqlplzNOlTJ7hU86Z0t+dpnYd3GhOYIkse C/Q1IBbzw= Received: from bai-oslab.tsinghua.edu.cn (unknown [166.111.70.58]) by smtp8 (Coremail) with SMTP id DMCowECpzG9qI5NWtG+dAA--.107S2; Mon, 11 Jan 2016 11:37:18 +0800 (CST) From: Jia-Ju Bai To: kvalo@codeaurora.org, zajec5@gmail.com, joe@perches.com, davem@davemloft.net, m@bues.ch, johannes.berg@intel.com Cc: linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] b43: Fix a memory leak in b43_bus_dev_ssb_init Date: Mon, 11 Jan 2016 11:37:36 +0800 Message-Id: <1452483457-568-1-git-send-email-baijiaju1990@163.com> X-Mailer: git-send-email 1.7.9.5 X-CM-TRANSID: DMCowECpzG9qI5NWtG+dAA--.107S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrtw4UCF4DGw47Ary8XF1DJrb_yoWxZFX_Cr 18CF1fJryrJw1jkr48CFsrZrWjvF1DXFn3G3ZIqayrKay7JrZ3JryFvFy3Jr9rur4IkFy7 Crnrt3W8A340vjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUjWEE5UUUUU== X-Originating-IP: [166.111.70.58] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/1tbiTg-selUCqW0oqAAAsE 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_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, 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 The memory allocated by kzalloc in b43_bus_dev_ssb_init is not freed. This patch fixes the bug by adding kfree in b43_ssb_remove. Signed-off-by: Jia-Ju Bai --- drivers/net/wireless/b43/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index ec013fb..6d251a0 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c @@ -5798,6 +5798,7 @@ static void b43_ssb_remove(struct ssb_device *sdev) b43_leds_unregister(wl); b43_wireless_exit(dev, wl); + kfree(dev); } static struct ssb_driver b43_ssb_driver = { From patchwork Wed Jan 13 14:44:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 8026131 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 CE68CBEEE5 for ; Wed, 13 Jan 2016 14:45:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 02C2920515 for ; Wed, 13 Jan 2016 14:45:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF39A20513 for ; Wed, 13 Jan 2016 14:45:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932540AbcAMOpM (ORCPT ); Wed, 13 Jan 2016 09:45:12 -0500 Received: from m12-12.163.com ([220.181.12.12]:55996 "EHLO m12-12.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754303AbcAMOpK (ORCPT ); Wed, 13 Jan 2016 09:45:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=8/5CZSumKGWs0Ei4G3 VphnXOAbVGc9u7B6i+QS+BQyA=; b=dLJDvbzQ+0AcvJ2ZNkqVxmpEbcCM0P3gFb Pi6zOBbNiZ7sikXQg514F+G07AqOPh/nbcR0Ef9zOF5Ws79p+3xljuQ4GpHzGr0x /YqI5M6OJyPOiquIhE0N7j0NcJv7+ATBAhi5UjCbw6FraAADEts28bWJgpuzW5s8 J/AcFQb8w= Received: from bai-oslab.tsinghua.edu.cn (unknown [166.111.70.58]) by smtp8 (Coremail) with SMTP id DMCowACnv4ezYpZWVxRaAA--.22198S2; Wed, 13 Jan 2016 22:44:06 +0800 (CST) From: Jia-Ju Bai To: andrea.merello@gmail.com, Larry.Finger@lwfinger.net, flamingice@sourmilk.net, kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] rtl818x_pci: Fix a memory leak in rtl8180_init_rx_ring Date: Wed, 13 Jan 2016 22:44:32 +0800 Message-Id: <1452696272-31229-1-git-send-email-baijiaju1990@163.com> X-Mailer: git-send-email 1.7.9.5 X-CM-TRANSID: DMCowACnv4ezYpZWVxRaAA--.22198S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7Ar47Gw4rGF18Gr1rZFW5Wrg_yoW8GF1rpr WYk3WFkr10yr1jqaykJay3Xr1rZw1rGF97WFW0yw15CFW3JFySqFyF934j9rn8WrWUWay5 XwsFvr15WFsIga7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UGZXwUUUUU= X-Originating-IP: [166.111.70.58] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/1tbiZRfuelWBOQshiwAAsq 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_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, 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 When dev_alloc_skb or pci_dma_mapping_error in rtl8180_init_rx_ring fails, the memory allocated by pci_zalloc_consistent is not freed. This patch fixes the bug by adding pci_free_consistent in error handling code. Signed-off-by: Jia-Ju Bai --- drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c b/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c index a43a16f..28479b1 100644 --- a/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c +++ b/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c @@ -1018,6 +1018,8 @@ static int rtl8180_init_rx_ring(struct ieee80211_hw *dev) dma_addr_t *mapping; entry = priv->rx_ring + priv->rx_ring_sz*i; if (!skb) { + pci_free_consistent(priv->pdev, priv->rx_ring_sz * 32, + priv->rx_ring, priv->rx_ring_dma); wiphy_err(dev->wiphy, "Cannot allocate RX skb\n"); return -ENOMEM; } @@ -1028,6 +1030,8 @@ static int rtl8180_init_rx_ring(struct ieee80211_hw *dev) if (pci_dma_mapping_error(priv->pdev, *mapping)) { kfree_skb(skb); + pci_free_consistent(priv->pdev, priv->rx_ring_sz * 32, + priv->rx_ring, priv->rx_ring_dma); wiphy_err(dev->wiphy, "Cannot map DMA for RX skb\n"); return -ENOMEM; } From patchwork Fri Jan 15 13:12:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 8040201 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A16199F859 for ; Fri, 15 Jan 2016 13:12:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D39EE2041A for ; Fri, 15 Jan 2016 13:12:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A78C201B9 for ; Fri, 15 Jan 2016 13:12:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755861AbcAONMY (ORCPT ); Fri, 15 Jan 2016 08:12:24 -0500 Received: from mout.web.de ([212.227.15.4]:59774 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753259AbcAONMW (ORCPT ); Fri, 15 Jan 2016 08:12:22 -0500 Received: from [192.168.1.2] ([78.53.181.97]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0M8zhl-1aS1Jm0pgr-00CNau; Fri, 15 Jan 2016 14:12:03 +0100 Subject: [PATCH v3 3/3] rsi: Replace variable initialisations by assignments in rsi_send_data_pkt() To: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Fariya Fatima , Jahnavi Meher , Kalle Valo References: <566ABCD9.1060404@users.sourceforge.net> <5687E169.4070704@users.sourceforge.net> <5698EE65.7010607@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall , "John W. Linville" From: SF Markus Elfring Message-ID: <5698F021.1070707@users.sourceforge.net> Date: Fri, 15 Jan 2016 14:12:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <5698EE65.7010607@users.sourceforge.net> X-Provags-ID: V03:K0:2vy0TvUfyAoEe8z2Jn4G/DfEKV1jTIrjO3nbUKgavolnp7jXyVV ieMxVK3MFEzILRFONb6+WUJjzOsg/Hu5TwhKP05lLP58eP56WLm13Mg258msov2uPjMLNf0 eHuBlOvfPoFaOPgI1HXgoSfTaVNRBuWQm9GMDutmzwJJnIU3P5r3qyrg08ueiP5gVIIqk0B 7ctozsQq7y9I8La2aAmtA== X-UI-Out-Filterresults: notjunk:1; V01:K0:+YuCLT11Lo0=:LY59Dn9lS3auhmx2VWL2r9 av+PWYvI3mXKBSt2yHov/T7tNP1c+73FrUK/tgkW36rAiGd0hAWSitE9tHHBP3rUTERLwufSB kG+pjvaPfBEKXHauVzxDkehmbOnlXMUmFYWUmvStuNpoIvYQZtT+qwKblZjmgsAfUeKIkmnCf AgbZLPoCwD2jSXlmQDK9aMvB8vLCjaQQTIPFBqHhOuhyPVpdw67VkYmCTLiYYFmj2RXUR7Ia9 6fP7avvLnPNa44yoFcQV7xigqqtalF4+lOW+eGcmB56nz+ch82fCD5n6qfdQqtlnl0JSUWoWW +d0hW173KptI2i/37+XH7tga9RGHUNAql6ji4g2hNNk5XlLQq9DcCbeUraePsqdAP1Tm+BZoU MCkAi3UlgAa+uB68nq0VG4zEl7t8jpO5f03esyDMNVH8MYr0NOf28BIrZqADgMphxMXsCrPZC 3paF+ra0b+x4UiiAc+qdrkOTGFukBPK0h7dswB/ymguVeCqemVzrgW7f23IK4nrvj484Ck3Ay D84K5HaQ8naO6WPe0hL9ndANu3Xyb7OjQDKQjEUbfTY3b6vPHOH5OjeP7VlzaohVNkVldwUTk Owt0sjXRb5a35jXILhSS+oU3A94f3LoMYDGVTRVSgZvve+bt3V5MrcPIiWI227uxEN/6NnFpT kz6CkXkYyMAL6Wmwbo+/3CSaaGOt9IH1wwu/BnFucTcpJsIUsbrtzFV0dwEnHGjYZkkac2G59 Hbcp+9o3BvCrZ6hIVFrlqcP1491yhQk1M4S+LYes15Xby2ZtzrwTmfbmXXjj5nPbX61JgZjp2 ILZ/HmJ 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 From: Markus Elfring Date: Fri, 15 Jan 2016 13:40:22 +0100 Replace explicit initialisation for two local variables at the beginning by assignments. Signed-off-by: Markus Elfring --- drivers/net/wireless/rsi/rsi_91x_pkt.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_pkt.c b/drivers/net/wireless/rsi/rsi_91x_pkt.c index 4322df1..2c18c01 100644 --- a/drivers/net/wireless/rsi/rsi_91x_pkt.c +++ b/drivers/net/wireless/rsi/rsi_91x_pkt.c @@ -26,12 +26,12 @@ */ int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb) { - struct rsi_hw *adapter = common->priv; + struct rsi_hw *adapter; struct ieee80211_hdr *tmp_hdr; struct ieee80211_tx_info *info; struct skb_info *tx_params; struct ieee80211_bss_conf *bss; - int status = -EINVAL; + int status; u8 ieee80211_size = MIN_802_11_HDR_LEN; u8 extnd_size; __le16 *frame_desc; @@ -41,8 +41,10 @@ int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb) bss = &info->control.vif->bss_conf; tx_params = (struct skb_info *)info->driver_data; - if (!bss->assoc) + if (!bss->assoc) { + status = -EINVAL; goto err; + } tmp_hdr = (struct ieee80211_hdr *)&skb->data[0]; seq_num = (le16_to_cpu(tmp_hdr->seq_ctrl) >> 4); @@ -97,7 +99,7 @@ int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb) frame_desc[7] = cpu_to_le16(((tx_params->tid & 0xf) << 4) | (skb->priority & 0xf) | (tx_params->sta_id << 8)); - + adapter = common->priv; status = adapter->host_intf_write_pkt(common->priv, skb->data, skb->len); From patchwork Wed Feb 3 05:21:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byeoungwook Kim X-Patchwork-Id: 8197881 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E660D9F37A for ; Wed, 3 Feb 2016 05:22:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 15EE420253 for ; Wed, 3 Feb 2016 05:22:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 39D1020218 for ; Wed, 3 Feb 2016 05:22:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751436AbcBCFVz (ORCPT ); Wed, 3 Feb 2016 00:21:55 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:34182 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750864AbcBCFVy (ORCPT ); Wed, 3 Feb 2016 00:21:54 -0500 Received: by mail-pf0-f194.google.com with SMTP id 65so484277pfd.1; Tue, 02 Feb 2016 21:21:53 -0800 (PST) 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=Ng49/is5Z6HpI9T7EVqEpITwVnNZClP2KZKZyUTniJo=; b=SPN2owjMkKDY4uxrpt3UEK2eG1s1XYi5985GPtneYo+iLzOuU5eNRler2S9clte2lg bp0cQEGAcNmb7nM3J00RBNxBVX41MJUKUpny3ckB+KKqV+4Glh86050C9iD9S+R6R9Hy 1Ne4teDrOyR8sf/vvQt2v183grtYbH1H4EkPU5X2JGrTdWY3UA+dRDVJZjhNOIiKxLBh e8/e4sExLbym8sMwHw2gJtEnzbX4Fh3HbHTFIWsej19DKJ9sWkWDx4ICB3PjB/ZT0+0s SC3rcVorHXBTEbIXXyftc19AKNh4J7sjFLJoghN1vLek3SBu2weQ/B+sQ6SGvtXkNQZa 6XQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=Ng49/is5Z6HpI9T7EVqEpITwVnNZClP2KZKZyUTniJo=; b=MOcXmuq6h0LgQroVmXWDyQvCvFpD5CdaIoBlp5hFtW9yhwuZZVCQ6golQIVdEsxalO e8dqfMnpyYPeaAEZddfWy38XqwDWtl+U2NokmgkW6hyrIs8sZDnpTavxwkPEyIF4nGq3 pylt7VFpG51C+5Z46j8KsIzRJJDpcdavvenNmYZp9b9NsVSllnL+WLcxButf5L1iJqMt JICfizOPLCzRdkT8nFhG2hTvT7wkEdOi/ATDyRGksKYaJhc+PwIWExuCPbkb9EiagP6L rY9kUiCLJNU6HN8xX8Ai4cpzZbJN3Hc5b6q5skwcMCHS+bkIn/uJVhbR3cDIRqLPMWtM 3WCA== X-Gm-Message-State: AG10YOS+RhwHpB4fqmoIrqmC9hmGawLrOUrgqqc7O1eAbHraiHEJjz8vQvoAtF8U8NLaAw== X-Received: by 10.98.14.68 with SMTP id w65mr54110717pfi.146.1454476913435; Tue, 02 Feb 2016 21:21:53 -0800 (PST) Received: from gmail.com ([210.118.75.116]) by smtp.gmail.com with ESMTPSA id 195sm3481527pfa.5.2016.02.02.21.21.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Feb 2016 21:21:52 -0800 (PST) Date: Wed, 3 Feb 2016 14:21:46 +0900 From: Byeoungwook Kim To: Larry.Finger@lwfinger.net Cc: kvalo@codeaurora.org, chaoming_li@realsil.com.cn, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lkp@intel.com, julian.calaby@gmail.com Subject: [PATCH v3] rtlwifi: Fix improve function 'rtl_addr_delay()' in core.c Message-ID: <20160203052146.GA15711@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FSL_HELO_FAKE, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID,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 Conditional codes in rtl_addr_delay() were improved in readability and performance by using switch codes. Reviewed-by: Julian Calaby Signed-off-by: Byeoungwook Kim Signed-off-by: Fengguang Wu --- V3 remove unneeded semicolon. V2 split in separate patchs. drivers/net/wireless/realtek/rtlwifi/core.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c index 4ae421e..63cda78 100644 --- a/drivers/net/wireless/realtek/rtlwifi/core.c +++ b/drivers/net/wireless/realtek/rtlwifi/core.c @@ -37,18 +37,26 @@ void rtl_addr_delay(u32 addr) { - if (addr == 0xfe) + switch (addr) { + case 0xfe: mdelay(50); - else if (addr == 0xfd) + break; + case 0xfd: mdelay(5); - else if (addr == 0xfc) + break; + case 0xfc: mdelay(1); - else if (addr == 0xfb) + break; + case 0xfb: udelay(50); - else if (addr == 0xfa) + break; + case 0xfa: udelay(5); - else if (addr == 0xf9) + break; + case 0xf9: udelay(1); + break; + } } EXPORT_SYMBOL(rtl_addr_delay);