Skip to content

Commit 9470074

Browse files
z3ntuandersson
authored andcommitted
soc: qcom: rmtfs: fix error handling reading qcom,vmid
of_property_count_u32_elems returns a negative integer when an error happens , but since the value was assigned to an unsigned integer, the check never worked correctly. Also print the correct variable in the error print, ret isn't used here. Fixes: e656cd0 ("soc: qcom: rmtfs: Optionally map RMTFS to more VMs") Signed-off-by: Luca Weiss <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 77bf4b3 commit 9470074

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/soc/qcom/rmtfs_mem.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
176176
struct reserved_mem *rmem;
177177
struct qcom_rmtfs_mem *rmtfs_mem;
178178
u32 client_id;
179-
u32 num_vmids, vmid[NUM_MAX_VMIDS];
179+
u32 vmid[NUM_MAX_VMIDS];
180+
int num_vmids;
180181
int ret, i;
181182

182183
rmem = of_reserved_mem_lookup(node);
@@ -229,7 +230,7 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev)
229230

230231
num_vmids = of_property_count_u32_elems(node, "qcom,vmid");
231232
if (num_vmids < 0) {
232-
dev_err(&pdev->dev, "failed to count qcom,vmid elements: %d\n", ret);
233+
dev_err(&pdev->dev, "failed to count qcom,vmid elements: %d\n", num_vmids);
233234
goto remove_cdev;
234235
} else if (num_vmids > NUM_MAX_VMIDS) {
235236
dev_warn(&pdev->dev,

0 commit comments

Comments
 (0)