From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756139AbcECPHm (ORCPT ); Tue, 3 May 2016 11:07:42 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49794 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755482AbcECPHk (ORCPT ); Tue, 3 May 2016 11:07:40 -0400 Date: Tue, 3 May 2016 08:07:39 -0700 From: Greg KH To: Thierry Reding Cc: Yi Zhang , linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH] base: dd: don't remove driver_data in -EPROBE_DEFER case Message-ID: <20160503150739.GA14897@kroah.com> References: <1457450122-5792-1-git-send-email-yizhang_hust@163.com> <20160503131126.GA18494@ulmo.ba.sec> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160503131126.GA18494@ulmo.ba.sec> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 03, 2016 at 03:11:26PM +0200, Thierry Reding wrote: > On Tue, Mar 08, 2016 at 11:15:22PM +0800, Yi Zhang wrote: > > the driver_data may be used for sanity check, it fails the > > probe() if driver_data is NULL after it is re-triggered. > > for example, soc_probe() in sound/soc/soc-core.c > > > > Signed-off-by: Yi Zhang > > --- > > drivers/base/dd.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > Hi Greg, > > This causes a boot regression on at least one board, caused by one of > the drivers looking at driver data to check whether or not the driver > has properly loaded. If the code encounters a non-NULL pointer it > tries to dereference it, but because it's already been freed there is > no memory backing it and things crash. > > I don't think keeping stale pointers around is a good idea. The whole > point of setting this to NULL in the core is so that probe failures > result in the same starting conditions no matter what. > > Can we please get this reverted? > > Cc'ing linux-tegra for visibility since that's where the boot regression > is observed. Now reverted, thanks for letting me know. greg k-h