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

Commit aa4d4815 authored by Sudarshan Rajagopalan's avatar Sudarshan Rajagopalan
Browse files

soc: qcom: mem-offline: Fix klocwork errors



Fix the NULL dereference Klocwork error report.

Change-Id: I7f092cb3817b19a041fbf090d2a8e53bb503c462
Signed-off-by: default avatarSudarshan Rajagopalan <sudaraja@codeaurora.org>
parent 51b768c5
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -324,10 +324,14 @@ static int mem_parse_dt(struct platform_device *pdev)
	struct device_node *node = pdev->dev.of_node;

	val = of_get_property(node, "granule", NULL);
	if (!val && !*val) {
	if (!val) {
		pr_err("mem-offine: granule property not found in DT\n");
		return -EINVAL;
	}
	if (!*val) {
		pr_err("mem-offine: invalid granule property\n");
		return -EINVAL;
	}
	offline_granule = be32_to_cpup(val);
	if (!offline_granule && !(offline_granule & (offline_granule - 1)) &&
			offline_granule * SZ_1M < MIN_MEMORY_BLOCK_SIZE) {