From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755499AbcBPQn2 (ORCPT ); Tue, 16 Feb 2016 11:43:28 -0500 Received: from mx2.suse.de ([195.135.220.15]:52332 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750981AbcBPQn1 (ORCPT ); Tue, 16 Feb 2016 11:43:27 -0500 Date: Tue, 16 Feb 2016 17:43:24 +0100 Message-ID: From: Takashi Iwai To: Mark Brown Cc: Arnd Bergmann , linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Jaroslav Kysela , Han Lu , Libin Yang , Thierry Reding , David Henningsson Subject: Re: [PATCH] sound: hdmi: avoid dereferencing uninitialized 'jack' pointer In-Reply-To: <20160216163840.GA7544@sirena.org.uk> References: <1455634059-1896914-1-git-send-email-arnd@arndb.de> <2573932.AU4HSxN0NE@wuerfel> <20160216163840.GA7544@sirena.org.uk> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.5 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 16 Feb 2016 17:38:40 +0100, Mark Brown wrote: > > On Tue, Feb 16, 2016 at 05:18:29PM +0100, Takashi Iwai wrote: > > Arnd Bergmann wrote: > > > > Another option might would be to change snd_jack_new() to return > > > an error if that SND_JACK is disabled, and then require all users > > > to handle the error gracefully, i.e. not fail the probe() function > > > but just not use the jack. > > > Yes, I thought of that, too. If select is no good option, it's a good > > alternative, indeed. > > It's going to be a bunch of work to implement though. Is it? Which driver would be broken? Many ASoC drivers just ignore the return error completely. Some treats as a fatal error, and the behavior would change, yes. But I don't think that such a driver would work without CONFIG_SND_JACK properly in anyway. Takashi