Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753894AbdLMTxX (ORCPT ); Wed, 13 Dec 2017 14:53:23 -0500 Received: from shards.monkeyblade.net ([184.105.139.130]:43812 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753345AbdLMTxV (ORCPT ); Wed, 13 Dec 2017 14:53:21 -0500 Date: Wed, 13 Dec 2017 14:53:19 -0500 (EST) Message-Id: <20171213.145319.1650448955612362760.davem@davemloft.net> To: baijiaju1990@163.com Cc: jes@trained-monkey.org, jes@wildopensource.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] hippi: Fix a Fix a possible sleep-in-atomic bug in rr_close From: David Miller In-Reply-To: <1513068592-23632-1-git-send-email-baijiaju1990@163.com> References: <1513068592-23632-1-git-send-email-baijiaju1990@163.com> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 13 Dec 2017 11:53:20 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 438 Lines: 15 From: Jia-Ju Bai Date: Tue, 12 Dec 2017 16:49:52 +0800 > The driver may sleep under a spinlock. > The function call path is: > rr_close (acquire the spinlock) > free_irq --> may sleep > > To fix it, free_irq is moved to the place without holding the spinlock. > > This bug is found by my static analysis tool(DSAC) and checked by my code review. > > Signed-off-by: Jia-Ju Bai Applied.