Skip to content

Commit

Permalink
ALSA: asihpi - fix potential NULL pointer dereference
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and tiwai committed Mar 12, 2013
1 parent 66efdc7 commit 2e9b9a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/pci/asihpi/asihpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2549,14 +2549,15 @@ 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;
struct hpi_control hpi_ctl, prev_ctl;

if (snd_BUG_ON(!asihpi))
return -EINVAL;
card = asihpi->card;
strcpy(card->mixername, "Asihpi Mixer");

err =
Expand Down

0 comments on commit 2e9b9a3

Please sign in to comment.