mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-07 11:28:32 +00:00
ALSA: asihpi - fix potential NULL pointer dereference
The dereference should be moved below the NULL test. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
66efdc71d9
commit
2e9b9a3c24
1 changed files with 2 additions and 1 deletions
|
@ -2549,7 +2549,7 @@ static int snd_asihpi_sampleclock_add(struct snd_card_asihpi *asihpi,
|
|||
|
||||
static int snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi)
|
||||
{
|
||||
struct snd_card *card = asihpi->card;
|
||||
struct snd_card *card;
|
||||
unsigned int idx = 0;
|
||||
unsigned int subindex = 0;
|
||||
int err;
|
||||
|
@ -2557,6 +2557,7 @@ static int snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi)
|
|||
|
||||
if (snd_BUG_ON(!asihpi))
|
||||
return -EINVAL;
|
||||
card = asihpi->card;
|
||||
strcpy(card->mixername, "Asihpi Mixer");
|
||||
|
||||
err =
|
||||
|
|
Loading…
Reference in a new issue