Skip to contentSkip to conversation

drm/omap: dmm_tiler: fix return error code in omap_dmm_probe()

PATCH In review Yang Yingliang 3 participants 3 messages Nov 17, 2020 – Nov 26, 2020

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

PATCH 1/1 drm/omap: dmm_tiler: fix return error code in omap_dmm_probe()

Return -ENOMEM when allocating refill memory failed.

Fixes 71e8831f6407 ("drm/omap: DMM/TILER support for OMAP4+ platform")
---
 drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +1 -0
index 42ec51bb7b1b..7f4317248812 100644
@@ -889,6 +889,7 @@ static int omap_dmm_probe(struct platform_device *dev)
 					   &omap_dmm->refill_pa, GFP_KERNEL);
 	if (!omap_dmm->refill_va) {
 		dev_err(&dev->dev, "could not allocate refill memory\n");
+		ret = -ENOMEM;
 		goto fail;
 	}
 
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hi

Am 17.11.20 um 07:10 schrieb Yang Yingliang:

Quoted 14 lines

Return -ENOMEM when allocating refill memory failed.

Fixes 71e8831f6407 ("drm/omap: DMM/TILER support for OMAP4+ platform")
---
 drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +0 -0
index 42ec51bb7b1b..7f4317248812 100644

drivers/gpu/drm/omapdrm/omap_dmm_tiler.c static int omap_dmm_probe(struct platform_device *dev) · line 892

Quoted 4 lines
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +1 -0
@@ -889,6 +889,7 @@ static int omap_dmm_probe(struct platform_device *dev)
 					   &omap_dmm->refill_pa, GFP_KERNEL);
 	if (!omap_dmm->refill_va) {
 		dev_err(&dev->dev, "could not allocate refill memory\n");
+		ret = -ENOMEM;

Thanks for the patch. I'll add it to drm-misc-next. There are more such errors here. If the very first allocation fails, the function returns -EFAULT, which makes no sense.

Best regards
Thomas

Quoted 4 lines
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +0 -0
 		goto fail;
 	}
 
Signature · 10 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
Quoted 24 lines · Thomas Zimmermann

Hi

Am 17.11.20 um 07:10 schrieb Yang Yingliang:

Quoted 14 lines

Return -ENOMEM when allocating refill memory failed.

Fixes 71e8831f6407 ("drm/omap: DMM/TILER support for OMAP4+ platform")
---
 drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +0 -0
index 42ec51bb7b1b..7f4317248812 100644

drivers/gpu/drm/omapdrm/omap_dmm_tiler.c static int omap_dmm_probe(struct platform_device *dev) · line 892

Quoted 4 lines
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +1 -0
@@ -889,6 +889,7 @@ static int omap_dmm_probe(struct platform_device *dev)
 					   &omap_dmm->refill_pa, GFP_KERNEL);
 	if (!omap_dmm->refill_va) {
 		dev_err(&dev->dev, "could not allocate refill memory\n");
+		ret = -ENOMEM;
Quoted 3 lines

Thanks for the patch. I'll add it to drm-misc-next. There are more such errors here. If the very first allocation fails, the function returns -EFAULT, which makes no sense.

Indeed. -EFAULT is quite an odd default value for ret... I'll drop the default and assign a real error value where needed.

Tomi

Signature · 6 lines
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel