mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/omap: dmm_tiler: fix return error code in omap_dmm_probe()
@ 2020-11-17  6:10 Yang Yingliang
  2020-11-17 13:41 ` Thomas Zimmermann
  0 siblings, 1 reply; 3+ messages in thread
From: Yang Yingliang @ 2020-11-17  6:10 UTC (permalink / raw)
  To: dri-devel, linux-kernel, tomi.valkeinen; +Cc: yangyingliang

Return -ENOMEM when allocating refill memory failed.

Fixes: 71e8831f6407 ("drm/omap: DMM/TILER support for OMAP4+ platform")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
index 42ec51bb7b1b..7f4317248812 100644
--- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
+++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
@@ -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;
 	}
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/omap: dmm_tiler: fix return error code in omap_dmm_probe()
  2020-11-17  6:10 [PATCH] drm/omap: dmm_tiler: fix return error code in omap_dmm_probe() Yang Yingliang
@ 2020-11-17 13:41 ` Thomas Zimmermann
  2020-11-26  6:19   ` Tomi Valkeinen
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Zimmermann @ 2020-11-17 13:41 UTC (permalink / raw)
  To: Yang Yingliang, dri-devel, linux-kernel, tomi.valkeinen

Hi

Am 17.11.20 um 07:10 schrieb Yang Yingliang:
> Return -ENOMEM when allocating refill memory failed.
> 
> Fixes: 71e8831f6407 ("drm/omap: DMM/TILER support for OMAP4+ platform")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> index 42ec51bb7b1b..7f4317248812 100644
> --- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> +++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> @@ -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;

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

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

>  		goto fail;
>  	}
>  
> 

-- 
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/omap: dmm_tiler: fix return error code in omap_dmm_probe()
  2020-11-17 13:41 ` Thomas Zimmermann
@ 2020-11-26  6:19   ` Tomi Valkeinen
  0 siblings, 0 replies; 3+ messages in thread
From: Tomi Valkeinen @ 2020-11-26  6:19 UTC (permalink / raw)
  To: Thomas Zimmermann, Yang Yingliang, dri-devel, linux-kernel

On 17/11/2020 15:41, Thomas Zimmermann wrote:
> Hi
> 
> Am 17.11.20 um 07:10 schrieb Yang Yingliang:
>> Return -ENOMEM when allocating refill memory failed.
>>
>> Fixes: 71e8831f6407 ("drm/omap: DMM/TILER support for OMAP4+ platform")
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>> ---
>>  drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
>> index 42ec51bb7b1b..7f4317248812 100644
>> --- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
>> +++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
>> @@ -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;
> 
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> 
> 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

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-26  6:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17  6:10 [PATCH] drm/omap: dmm_tiler: fix return error code in omap_dmm_probe() Yang Yingliang
2020-11-17 13:41 ` Thomas Zimmermann
2020-11-26  6:19   ` Tomi Valkeinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®