lkml.org 
[lkml]   [2016]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] sound: hdmi: avoid dereferencing uninitialized 'jack' pointer
Date
On Tuesday 16 February 2016 16:49:42 Takashi Iwai wrote:
>
> Thanks for the patch. But I think it's cleaner to fix Kconfig.
>
> Thinking more of it, maybe splitting jack stuff as a separate module
> and does reverse-select to CONFIG_INPUT would be better. Then its
> users can select simply SND_JACK, and everything would fit.
>
>

Adding 'select INPUT' is rather nasty, I think that can lead to circular
dependencies, and would likely upset users of small embedded systems
that want to use audio but don't want to use input.

Generally speaking, I would recommend never using 'select' on a user
visible Kconfig symbol.

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.

Arnd

\
 
 \ /
  Last update: 2016-02-16 17:41    [W:0.064 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site