From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BBFA749D for ; Thu, 12 Jan 2023 14:12:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5822C433D2; Thu, 12 Jan 2023 14:12:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673532739; bh=uxQnYW8vZrpVZF7S3SZawlZo1xpMabzvtHsshOawDjE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QX+ttTNZ5r+G2doW45drzNFxG3N9gOUZ5FfQD9qIV4Gp+18EPip7lNPKGNyy7GczP f356fy0xA62kBUK5nYz+tWls3Y+qutFcKZFgm3BXRLBRN8/4h9EwpPiRHKks5t0A6q dYOanS8v9UGTXQylH2ubeAxVLskeHzzX7C2GRp88= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yang Yingliang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 260/783] net: ethernet: dnet: dont call dev_kfree_skb() under spin_lock_irqsave() Date: Thu, 12 Jan 2023 14:49:36 +0100 Message-Id: <20230112135536.467128732@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112135524.143670746@linuxfoundation.org> References: <20230112135524.143670746@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Yang Yingliang [ Upstream commit f07fadcbee2a5e84caa67c7c445424200bffb60b ] It is not allowed to call kfree_skb() or consume_skb() from hardware interrupt context or with hardware interrupts being disabled. In this case, the lock is used to protected 'bp', so we can move dev_kfree_skb() after the spin_unlock_irqrestore(). Fixes: 4796417417a6 ("dnet: Dave DNET ethernet controller driver (updated)") Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/dnet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/dnet.c b/drivers/net/ethernet/dnet.c index 48c6eb142dcc..05a0cc583f8a 100644 --- a/drivers/net/ethernet/dnet.c +++ b/drivers/net/ethernet/dnet.c @@ -550,11 +550,11 @@ static netdev_tx_t dnet_start_xmit(struct sk_buff *skb, struct net_device *dev) skb_tx_timestamp(skb); + spin_unlock_irqrestore(&bp->lock, flags); + /* free the buffer */ dev_kfree_skb(skb); - spin_unlock_irqrestore(&bp->lock, flags); - return NETDEV_TX_OK; } -- 2.35.1