Skip to contentSkip to conversation

iommu/msm: Return -ENOMEM on memory allocation failure in probe

PATCH Applied Vladimir Zapolskiy 4 participants 4 messages Jul 1 – Jul 9

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/msm: Return -ENOMEM on memory allocation failure in probe

If dynamic memory allocation in driver's probe function execution fails, it should be reported to the driver's framework with -ENOMEM error code.

Fixes 109bd48ea2e1 ("iommu/msm: Add DT adaptation")
---
 drivers/iommu/msm_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/msm_iommu.c +1 -1
index 0ad5ff431d5b..708baeb29c03 100644
@@ -720,7 +720,7 @@ static int msm_iommu_probe(struct platform_device *pdev)
 
 	iommu = devm_kzalloc(&pdev->dev, sizeof(*iommu), GFP_KERNEL);
 	if (!iommu)
-		return -ENODEV;
+		return -ENOMEM;
 
 	iommu->dev = &pdev->dev;
 	INIT_LIST_HEAD(&iommu->ctx_list);
Signature · 1 line
2.51.0
Reviewed-by on v1 1/1
#2 lore raw
In reply to Vladimir Zapolskiy
Quoted 9 lines · Vladimir Zapolskiy

If dynamic memory allocation in driver's probe function execution fails, it should be reported to the driver's framework with -ENOMEM error code.

Fixes 109bd48ea2e1 ("iommu/msm: Add DT adaptation")
---
 drivers/iommu/msm_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 2 lines
With best wishes
Dmitry