mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-27 20:07:09 +00:00
ALSA: jack: Fix another NULL dereference due to empty input jack
Another fixes for NULL jack->input_dev in some places in jack.c.
Fixes: 2ba2dfa1fc
('ALSA: hda - Update to use the new jack kctls method')
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
6ed9495e22
commit
43b2cd547e
@ -87,6 +87,10 @@ static int snd_jack_dev_register(struct snd_device *device)
|
|||||||
|
|
||||||
snprintf(jack->name, sizeof(jack->name), "%s %s",
|
snprintf(jack->name, sizeof(jack->name), "%s %s",
|
||||||
card->shortname, jack->id);
|
card->shortname, jack->id);
|
||||||
|
|
||||||
|
if (!jack->input_dev)
|
||||||
|
return 0;
|
||||||
|
|
||||||
jack->input_dev->name = jack->name;
|
jack->input_dev->name = jack->name;
|
||||||
|
|
||||||
/* Default to the sound card device. */
|
/* Default to the sound card device. */
|
||||||
@ -278,6 +282,8 @@ EXPORT_SYMBOL(snd_jack_new);
|
|||||||
void snd_jack_set_parent(struct snd_jack *jack, struct device *parent)
|
void snd_jack_set_parent(struct snd_jack *jack, struct device *parent)
|
||||||
{
|
{
|
||||||
WARN_ON(jack->registered);
|
WARN_ON(jack->registered);
|
||||||
|
if (!jack->input_dev)
|
||||||
|
return;
|
||||||
|
|
||||||
jack->input_dev->dev.parent = parent;
|
jack->input_dev->dev.parent = parent;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user