[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230530233643.4044823-4-quic_bjorande@quicinc.com>
Date: Tue, 30 May 2023 16:36:43 -0700
From: Bjorn Andersson <quic_bjorande@...cinc.com>
To: Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>
CC: Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
<linux-arm-msm@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH v2 3/3] soc: qcom: rtmfs: Handle reserved-memory allocation issues
In the even that Linux failed to allocate the reserved memory range
specified in the DeviceTree, the size of the reserved_mem will be 0,
which results in a oops when memory remapping is attempted.
Detect this and report that the memory region was not found instead.
Signed-off-by: Bjorn Andersson <quic_bjorande@...cinc.com>
---
Changes since v1:
- New patch
drivers/soc/qcom/rmtfs_mem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/qcom/rmtfs_mem.c b/drivers/soc/qcom/rmtfs_mem.c
index 28238974d913..e3a55fa041f9 100644
--- a/drivers/soc/qcom/rmtfs_mem.c
+++ b/drivers/soc/qcom/rmtfs_mem.c
@@ -180,7 +180,7 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
int ret, i;
rmem = of_reserved_mem_lookup(node);
- if (!rmem) {
+ if (!rmem || !rmem->size) {
dev_err(&pdev->dev, "failed to acquire memory region\n");
return -EINVAL;
}
--
2.25.1
Powered by blists - more mailing lists