提交 7cf9bb21 编写于 作者: D Dan Carpenter 提交者: Takashi Iwai

ALSA: lola: NULL deref on allocation error

"chip" is NULL here.  We don't need a printk here because kmalloc() has
it built in.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 31278997
...@@ -586,7 +586,6 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci, ...@@ -586,7 +586,6 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci,
chip = kzalloc(sizeof(*chip), GFP_KERNEL); chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (!chip) { if (!chip) {
dev_err(chip->card->dev, "cannot allocate chip\n");
pci_disable_device(pci); pci_disable_device(pci);
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册