From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967256AbdADPkw (ORCPT ); Wed, 4 Jan 2017 10:40:52 -0500 Received: from mx2.suse.de ([195.135.220.15]:47221 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757498AbdADPkv (ORCPT ); Wed, 4 Jan 2017 10:40:51 -0500 Date: Wed, 4 Jan 2017 16:40:49 +0100 From: "Luis R. Rodriguez" To: Ming Lei Cc: Chris Wilson , Linux Kernel Mailing List , "Luis R. Rodriguez" , Greg Kroah-Hartman Subject: Re: [PATCH] firmware: Prevent oops on delayed abort Message-ID: <20170104154049.GG13946@wotan.suse.de> References: <20170104093131.5982-1-chris@chris-wilson.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 04, 2017 at 07:12:11PM +0800, Ming Lei wrote: > On Wed, Jan 4, 2017 at 5:31 PM, Chris Wilson wrote: > > If the firmware load is slow and cancelled, we may call fw_load_abort() > > twice and promptly oops on the second with a NULL dereference. > > > > Signed-off-by: Chris Wilson > > Cc: Ming Lei > > Cc: "Luis R. Rodriguez" > > Cc: Greg Kroah-Hartman > > --- > > drivers/base/firmware_class.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c > > index 4497d263209f..d03e21c1d2f3 100644 > > --- a/drivers/base/firmware_class.c > > +++ b/drivers/base/firmware_class.c > > @@ -557,6 +557,9 @@ static void fw_load_abort(struct firmware_priv *fw_priv) > > { > > struct firmware_buf *buf = fw_priv->buf; > > > > + if (!buf) > > + return; > > + > > __fw_load_abort(buf); > > > > /* avoid user action after loading abort */ > > -- > > 2.11.0 > > > > Looks fine, > > Acked-by: Ming Lei But does this fix an actual oops or just theoretical? If it does can you include the trace, and amend the commit log to Cc stable so this gets properly propagated into the stable kernels? Luis