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

Commit 0e234049 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

sound: usb: Add NULL check on return value of iommu_domain_alloc()



Upon allocation failure iommu_domain_alloc() returns NULL.
Driver is not checking for NULL value, which leads to NULL
pointer dereference later.

Change-Id: I9788412af3a34aca8fa8519e7ae6f3349f263a1e
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 008f057b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1007,8 +1007,8 @@ static int uaudio_qmi_plat_probe(struct platform_device *pdev)
	}

	uaudio_qdev->domain = iommu_domain_alloc(msm_iommu_get_bus(&pdev->dev));
	if (!uaudio_qdev) {
		dev_err(&pdev->dev, "failed to callocate iommu domin\n");
	if (!uaudio_qdev->domain) {
		dev_err(&pdev->dev, "failed to callocate iommu domain\n");
		return -ENODEV;
	}