Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c45b9de4 authored by Ido Shayevitz's avatar Ido Shayevitz Committed by Stephen Boyd
Browse files

usb: usb_bam: Fix issue for not checking NULL returned value



Ensure to correctly check the right pointer returned
from a call to function platform_get_resource_byname()
in order to prevent accessing this pointer afterwards
in case this pointer is NULL.

Change-Id: I8f6ba2944a4c60d2b4e668686c8bf7bc2640f46b
CRs-Fixed: 535640
Signed-off-by: default avatarIdo Shayevitz <idos@codeaurora.org>
parent 4b321cbd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2552,7 +2552,7 @@ static int usb_bam_init(int bam_idx)

		ram_resource = platform_get_resource_byname(ctx.usb_bam_pdev,
			IORESOURCE_MEM, "qscratch_ram1_reg");
		if (!res) {
		if (!ram_resource) {
			dev_err(&ctx.usb_bam_pdev->dev, "Unable to get qscratch\n");
			ret = -ENODEV;
			goto free_bam_regs;