]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: pcm: Check for null pointer of pointer substream before dereferencing it
authorColin Ian King <colin.i.king@gmail.com>
Sun, 24 Apr 2022 20:59:45 +0000 (21:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:49 +0000 (10:22 +0200)
commit175c869ccec57fdfdcd95ef0e6141a7046a37a7b
tree4a2c17be66ac6bd1b7069ca18b91be65ce864c46
parent13311beb7659a2241c58aa2e7efe4bdca8a3c367
ALSA: pcm: Check for null pointer of pointer substream before dereferencing it

[ Upstream commit 4480b91405d55a8c8ea7c6d3077768f1c3829500 ]

Pointer substream is being dereferenced on the assignment of pointer card
before substream is being null checked with the macro PCM_RUNTIME_CHECK.
Although PCM_RUNTIME_CHECK calls BUG_ON, it still is useful to perform the
the pointer check before card is assigned.

Fixes: 88dea208e6da ("ALSA: pcm: Set per-card upper limit of PCM buffer allocations")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20220424205945.1372247-1-colin.i.king@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/core/pcm_memory.c