From patchwork Tue Nov 1 14:48:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9407493 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 09F0C600C8 for ; Tue, 1 Nov 2016 14:48:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEC4C29994 for ; Tue, 1 Nov 2016 14:48:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E357229996; Tue, 1 Nov 2016 14:48:55 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 916F229994 for ; Tue, 1 Nov 2016 14:48:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424516AbcKAOsy (ORCPT ); Tue, 1 Nov 2016 10:48:54 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33103 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033997AbcKAOsx (ORCPT ); Tue, 1 Nov 2016 10:48:53 -0400 Received: by mail-pf0-f194.google.com with SMTP id a136so8475372pfa.0 for ; Tue, 01 Nov 2016 07:48:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/+/1cySm/AwNnS6NlyBkrXJEoXtUVt32PCG6962kUTs=; b=yk8N9QpLabx/xTMJaTRwY38FMau5NgBU23J3Vo99HLarqp57OaCToEV/n+ci66YJJz GlW0cDq8mPc7z3bH9syWL9dBYSTglZMP6QmjEdLIZOqPAOt0sDVEX/SA2nEj1oIDrOei K934rM5zZjrAiDCSpDmXO+3bsQHj6YFjWcLn+dcuFcefEPyS7yYHu9Xl5YVHrMjlsL4p VeArLaAPyQ4Wq3ikJIsOzgayQEW1I3FW6f0H+I0aoeslcMEQlKMkUa3P/mOkJswosO34 McT24xB28Qdwg9r1b74NI5sYoJCSV1Zkx74ThxmmqkRcbdgCHFYGzatMtwmx0UXeXqvk kxZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/+/1cySm/AwNnS6NlyBkrXJEoXtUVt32PCG6962kUTs=; b=D3NASK1RW2XIr6QmcuQ4O4tm+li+lqm2gm2OLeW93tyHmKUlddbTgtYS2z7RU7idio pgtkSxmVV7/ozR3iuaTl1LSXjDcxJwyi5xW6IxNS7KolJn+i3KepFR5aY3SaiEShIhOx LxslX73nCXr0HvEMXfy30dRKp4R/JCiFmZZXqL2keWk7CBEuDeC6Cy2f/YA0qY9+p/ML 5KkNjjwRtdcLFgIcN+bejtITac/biiJsT8Y3TZYdiD1jdS+f3yhZu3vVPTb3hb7EMUNg ZRMjbLwIb3wysd6/k0tmFizHKap9BzAuIJ0QKC7EDah3Jd5ncJiLRtpPZw0NFxQNEDRG jV7A== X-Gm-Message-State: ABUngvdS+9g3CUEqUOwmpw19vwLWwaP8Ongt2jyttOoV+pvoDCvIEJtH0/ZokZQ82DEvaQ== X-Received: by 10.99.173.3 with SMTP id g3mr50150162pgf.12.1478011732772; Tue, 01 Nov 2016 07:48:52 -0700 (PDT) Received: from 192.168.0.37 (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id e7sm42776381pfa.65.2016.11.01.07.48.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Nov 2016 07:48:52 -0700 (PDT) From: Wei Yongjun To: Larry Finger , Chaoming Li , Kalle Valo Cc: Wei Yongjun , linux-wireless@vger.kernel.org Subject: [PATCH net-next] rtlwifi: Use dev_kfree_skb_irq instead of kfree_skb Date: Tue, 1 Nov 2016 14:48:40 +0000 Message-Id: <1478011720-27363-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 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: Wei Yongjun It is not allowed to call kfree_skb() from hardware interrupt context or with interrupts being disabled, spin_lock_irqsave() make sure always in irq disable context. So the kfree_skb() should be replaced with dev_kfree_skb_irq(). This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun --- drivers/net/wireless/realtek/rtlwifi/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c index 8e7f23c..e89681d 100644 --- a/drivers/net/wireless/realtek/rtlwifi/core.c +++ b/drivers/net/wireless/realtek/rtlwifi/core.c @@ -1832,7 +1832,7 @@ bool rtl_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb) spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags); pskb = __skb_dequeue(&ring->queue); - kfree_skb(pskb); + dev_kfree_skb_irq(pskb); /*this is wrong, fill_tx_cmddesc needs update*/ pdesc = &ring->desc[0];