mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
usb: gadget: r8a66597: Add missing null check on return from platform_get_resource
[ Upstream commit9c2076090c] The call to platform_get_resource can potentially return a NULL pointer on failure, so add this check and return -EINVAL if it fails. Fixes:c41442474a("usb: gadget: R8A66597 peripheral controller support.") Signed-off-by: Colin Ian King <colin.king@canonical.com> Addresses-Coverity: ("Dereference null return") Link: https://lore.kernel.org/r/20210406184510.433497-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
ce02e58ddf
commit
e38a77c48a
|
|
@ -1849,6 +1849,8 @@ static int r8a66597_probe(struct platform_device *pdev)
|
||||||
return PTR_ERR(reg);
|
return PTR_ERR(reg);
|
||||||
|
|
||||||
ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
||||||
|
if (!ires)
|
||||||
|
return -EINVAL;
|
||||||
irq = ires->start;
|
irq = ires->start;
|
||||||
irq_trigger = ires->flags & IRQF_TRIGGER_MASK;
|
irq_trigger = ires->flags & IRQF_TRIGGER_MASK;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user