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

Commit 54495394 authored by Liam Mark's avatar Liam Mark Committed by Prakash Gupta
Browse files

drivers: qcom: cmd-db: Initialize resource name



Resource name must be initialized otherwise it will contain a garbage
value which will cause a crash when it is dereferenced, such as when a
user calls 'cat /proc/iomem'.

Initialize to name to NULL and let the devm_ioremap_resource call assign
the device name as the name.

Change-Id: I4667a288bc6dcf68aeb46c62fc4be86788fd8887
Signed-off-by: default avatarLiam Mark <lmark@codeaurora.org>
parent 63098a4e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -365,6 +365,7 @@ static int cmd_db_dev_probe(struct platform_device *pdev)
	res.start = readl_relaxed(dict);
	res.end = res.start + readl_relaxed(dict + 0x4);
	res.flags = IORESOURCE_MEM;
	res.name = NULL;
	iounmap(dict);

	start_addr = devm_ioremap_resource(&pdev->dev, &res);