You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
ALSA: jack: Check the return value of kstrdup()
commit c01c1db1dc upstream.
kstrdup() can return NULL, it is better to check the return value of it.
Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/tencent_094816F3522E0DC704056C789352EBBF0606@qq.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
51c7b2a7b8
commit
a96c08e0b4
@@ -220,6 +220,10 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
|
||||
return -ENOMEM;
|
||||
|
||||
jack->id = kstrdup(id, GFP_KERNEL);
|
||||
if (jack->id == NULL) {
|
||||
kfree(jack);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* don't creat input device for phantom jack */
|
||||
if (!phantom_jack) {
|
||||
|
||||
Reference in New Issue
Block a user