diff options
| author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-03-11 12:16:40 -0400 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2013-03-12 03:34:36 -0400 |
| commit | 2e9b9a3c243b1bc1fc9d1e84fcbc32568467bf8e (patch) | |
| tree | 27162877fe24366ffcb66f8adfa08a780452208e | |
| parent | 66efdc71d95887b652a742a5dae51fa834d71465 (diff) | |
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>
| -rw-r--r-- | sound/pci/asihpi/asihpi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index 3536b076b529..0aabfedeecba 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c | |||
| @@ -2549,7 +2549,7 @@ static int snd_asihpi_sampleclock_add(struct snd_card_asihpi *asihpi, | |||
| 2549 | 2549 | ||
| 2550 | static int snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi) | 2550 | static int snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi) |
| 2551 | { | 2551 | { |
| 2552 | struct snd_card *card = asihpi->card; | 2552 | struct snd_card *card; |
| 2553 | unsigned int idx = 0; | 2553 | unsigned int idx = 0; |
| 2554 | unsigned int subindex = 0; | 2554 | unsigned int subindex = 0; |
| 2555 | int err; | 2555 | int err; |
| @@ -2557,6 +2557,7 @@ static int snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi) | |||
| 2557 | 2557 | ||
| 2558 | if (snd_BUG_ON(!asihpi)) | 2558 | if (snd_BUG_ON(!asihpi)) |
| 2559 | return -EINVAL; | 2559 | return -EINVAL; |
| 2560 | card = asihpi->card; | ||
| 2560 | strcpy(card->mixername, "Asihpi Mixer"); | 2561 | strcpy(card->mixername, "Asihpi Mixer"); |
| 2561 | 2562 | ||
| 2562 | err = | 2563 | err = |
