提交 549e8292 编写于 作者: T Takashi Iwai

ALSA: hda/ca0132 - Fix possible NULL dereference

Spotted by smatch,
  sound/pci/hda/patch_ca0132.c:1950 dspxfr_image() error: potential
  null dereference 'dma_engine'.  (kzalloc returns null)
  sound/pci/hda/patch_ca0132.c:1950 dspxfr_image() error: we
  previously assumed 'dma_engine' could be null (see line 1857)
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 425a7880
......@@ -2416,15 +2416,13 @@ static int dspxfr_image(struct hda_codec *codec,
return -EINVAL;
dma_engine = kzalloc(sizeof(*dma_engine), GFP_KERNEL);
if (!dma_engine) {
status = -ENOMEM;
goto exit;
}
if (!dma_engine)
return -ENOMEM;
dma_engine->dmab = kzalloc(sizeof(*dma_engine->dmab), GFP_KERNEL);
if (!dma_engine->dmab) {
status = -ENOMEM;
goto exit;
kfree(dma_engine);
return -ENOMEM;
}
dma_engine->codec = codec;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册