projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0189355
)
ALSA: n64: check return value after calling platform_get_resource()
author
Yang Yingliang
<yangyingliang@huawei.com>
Thu, 10 Jun 2021 12:49:58 +0000
(20:49 +0800)
committer
Takashi Iwai
<tiwai@suse.de>
Sat, 12 Jun 2021 07:31:13 +0000
(09:31 +0200)
It will cause null-ptr-deref if platform_get_resource() returns NULL,
we need check the return value.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link:
https://lore.kernel.org/r/20210610124958.116142-1-yangyingliang@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/mips/snd-n64.c
patch
|
blob
|
blame
|
history
diff --git
a/sound/mips/snd-n64.c
b/sound/mips/snd-n64.c
index e35e93157755f0bf1e61ca4987b76f59dc8db3c6..463a6fe589eb267f06e7debd87e7ddae054ef8ae 100644
(file)
--- a/
sound/mips/snd-n64.c
+++ b/
sound/mips/snd-n64.c
@@
-338,6
+338,10
@@
static int __init n64audio_probe(struct platform_device *pdev)
strcpy(card->longname, "N64 Audio");
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+ if (!res) {
+ err = -EINVAL;
+ goto fail_dma_alloc;
+ }
if (devm_request_irq(&pdev->dev, res->start, n64audio_isr,
IRQF_SHARED, "N64 Audio", priv)) {
err = -EBUSY;