* [PATCH] drm/nouveau: fix an error code in nouveau_backlight_init()
@ 2021-04-14 5:58 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2021-04-14 5:58 UTC (permalink / raw)
To: Ben Skeggs, Pierre Moreau
Cc: David Airlie, Daniel Vetter, dri-devel, nouveau, kernel-janitors
If nouveau_get_backlight_name() fails then this should return -ENOMEM
but currently it returns success.
Fixes: db1a0ae21461 ("drm/nouveau/bl: Assign different names to interfaces")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This is from static analysis. In the original commit db1a0ae21461
("drm/nouveau/bl: Assign different names to interfaces") then returning
zero seemed to be a very deliberate choice. I do think it was wrong
though and -ENOMEM is the currect return.
drivers/gpu/drm/nouveau/nouveau_backlight.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
index 72f35a2babcb..3786b1c85182 100644
--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
+++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
@@ -274,6 +274,7 @@ nouveau_backlight_init(struct drm_connector *connector)
if (!nouveau_get_backlight_name(backlight_name, bl)) {
NV_ERROR(drm, "Failed to retrieve a unique name for the backlight interface\n");
+ ret = -ENOMEM;
goto fail_alloc;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Nouveau] [PATCH] drm/nouveau: fix an error code in nouveau_backlight_init()
@ 2021-04-14 5:58 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2021-04-14 5:58 UTC (permalink / raw)
To: Ben Skeggs, Pierre Moreau
Cc: David Airlie, nouveau, kernel-janitors, dri-devel, Daniel Vetter
If nouveau_get_backlight_name() fails then this should return -ENOMEM
but currently it returns success.
Fixes: db1a0ae21461 ("drm/nouveau/bl: Assign different names to interfaces")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This is from static analysis. In the original commit db1a0ae21461
("drm/nouveau/bl: Assign different names to interfaces") then returning
zero seemed to be a very deliberate choice. I do think it was wrong
though and -ENOMEM is the currect return.
drivers/gpu/drm/nouveau/nouveau_backlight.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
index 72f35a2babcb..3786b1c85182 100644
--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
+++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
@@ -274,6 +274,7 @@ nouveau_backlight_init(struct drm_connector *connector)
if (!nouveau_get_backlight_name(backlight_name, bl)) {
NV_ERROR(drm, "Failed to retrieve a unique name for the backlight interface\n");
+ ret = -ENOMEM;
goto fail_alloc;
}
--
2.30.2
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] drm/nouveau: fix an error code in nouveau_backlight_init()
@ 2021-04-14 5:58 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2021-04-14 5:58 UTC (permalink / raw)
To: Ben Skeggs, Pierre Moreau
Cc: David Airlie, nouveau, kernel-janitors, dri-devel
If nouveau_get_backlight_name() fails then this should return -ENOMEM
but currently it returns success.
Fixes: db1a0ae21461 ("drm/nouveau/bl: Assign different names to interfaces")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This is from static analysis. In the original commit db1a0ae21461
("drm/nouveau/bl: Assign different names to interfaces") then returning
zero seemed to be a very deliberate choice. I do think it was wrong
though and -ENOMEM is the currect return.
drivers/gpu/drm/nouveau/nouveau_backlight.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
index 72f35a2babcb..3786b1c85182 100644
--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
+++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
@@ -274,6 +274,7 @@ nouveau_backlight_init(struct drm_connector *connector)
if (!nouveau_get_backlight_name(backlight_name, bl)) {
NV_ERROR(drm, "Failed to retrieve a unique name for the backlight interface\n");
+ ret = -ENOMEM;
goto fail_alloc;
}
--
2.30.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Nouveau] [PATCH] drm/nouveau: fix an error code in nouveau_backlight_init()
2021-04-14 5:58 ` [Nouveau] " Dan Carpenter
(?)
@ 2021-04-19 15:30 ` Pierre Moreau
-1 siblings, 0 replies; 6+ messages in thread
From: Pierre Moreau @ 2021-04-19 15:30 UTC (permalink / raw)
To: Dan Carpenter
Cc: Ben Skeggs, David Airlie, nouveau, kernel-janitors, dri-devel,
Daniel Vetter
[-- Attachment #1: Type: text/plain, Size: 1572 bytes --]
I can not remember why the original code did return 0 rather than an error, but
-ENOMEM seems indeed way more fitting.
Reviewed-by: Pierre Moreau <pierre.morrow@free.fr>
On 2021-04-14 — 08:58, Dan Carpenter wrote:
> If nouveau_get_backlight_name() fails then this should return -ENOMEM
> but currently it returns success.
>
> Fixes: db1a0ae21461 ("drm/nouveau/bl: Assign different names to interfaces")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> This is from static analysis. In the original commit db1a0ae21461
> ("drm/nouveau/bl: Assign different names to interfaces") then returning
> zero seemed to be a very deliberate choice. I do think it was wrong
> though and -ENOMEM is the currect return.
>
> drivers/gpu/drm/nouveau/nouveau_backlight.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
> index 72f35a2babcb..3786b1c85182 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
> @@ -274,6 +274,7 @@ nouveau_backlight_init(struct drm_connector *connector)
>
> if (!nouveau_get_backlight_name(backlight_name, bl)) {
> NV_ERROR(drm, "Failed to retrieve a unique name for the backlight interface\n");
> + ret = -ENOMEM;
> goto fail_alloc;
> }
>
> --
> 2.30.2
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Nouveau] [PATCH] drm/nouveau: fix an error code in nouveau_backlight_init()
@ 2021-04-19 15:30 ` Pierre Moreau
0 siblings, 0 replies; 6+ messages in thread
From: Pierre Moreau @ 2021-04-19 15:30 UTC (permalink / raw)
To: Dan Carpenter
Cc: David Airlie, nouveau, kernel-janitors, dri-devel, Ben Skeggs,
Daniel Vetter
[-- Attachment #1.1: Type: text/plain, Size: 1572 bytes --]
I can not remember why the original code did return 0 rather than an error, but
-ENOMEM seems indeed way more fitting.
Reviewed-by: Pierre Moreau <pierre.morrow@free.fr>
On 2021-04-14 — 08:58, Dan Carpenter wrote:
> If nouveau_get_backlight_name() fails then this should return -ENOMEM
> but currently it returns success.
>
> Fixes: db1a0ae21461 ("drm/nouveau/bl: Assign different names to interfaces")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> This is from static analysis. In the original commit db1a0ae21461
> ("drm/nouveau/bl: Assign different names to interfaces") then returning
> zero seemed to be a very deliberate choice. I do think it was wrong
> though and -ENOMEM is the currect return.
>
> drivers/gpu/drm/nouveau/nouveau_backlight.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
> index 72f35a2babcb..3786b1c85182 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
> @@ -274,6 +274,7 @@ nouveau_backlight_init(struct drm_connector *connector)
>
> if (!nouveau_get_backlight_name(backlight_name, bl)) {
> NV_ERROR(drm, "Failed to retrieve a unique name for the backlight interface\n");
> + ret = -ENOMEM;
> goto fail_alloc;
> }
>
> --
> 2.30.2
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Nouveau] [PATCH] drm/nouveau: fix an error code in nouveau_backlight_init()
@ 2021-04-19 15:30 ` Pierre Moreau
0 siblings, 0 replies; 6+ messages in thread
From: Pierre Moreau @ 2021-04-19 15:30 UTC (permalink / raw)
To: Dan Carpenter
Cc: David Airlie, nouveau, kernel-janitors, dri-devel, Ben Skeggs
[-- Attachment #1.1: Type: text/plain, Size: 1572 bytes --]
I can not remember why the original code did return 0 rather than an error, but
-ENOMEM seems indeed way more fitting.
Reviewed-by: Pierre Moreau <pierre.morrow@free.fr>
On 2021-04-14 — 08:58, Dan Carpenter wrote:
> If nouveau_get_backlight_name() fails then this should return -ENOMEM
> but currently it returns success.
>
> Fixes: db1a0ae21461 ("drm/nouveau/bl: Assign different names to interfaces")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> This is from static analysis. In the original commit db1a0ae21461
> ("drm/nouveau/bl: Assign different names to interfaces") then returning
> zero seemed to be a very deliberate choice. I do think it was wrong
> though and -ENOMEM is the currect return.
>
> drivers/gpu/drm/nouveau/nouveau_backlight.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
> index 72f35a2babcb..3786b1c85182 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
> @@ -274,6 +274,7 @@ nouveau_backlight_init(struct drm_connector *connector)
>
> if (!nouveau_get_backlight_name(backlight_name, bl)) {
> NV_ERROR(drm, "Failed to retrieve a unique name for the backlight interface\n");
> + ret = -ENOMEM;
> goto fail_alloc;
> }
>
> --
> 2.30.2
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-04-19 18:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14 5:58 [PATCH] drm/nouveau: fix an error code in nouveau_backlight_init() Dan Carpenter
2021-04-14 5:58 ` Dan Carpenter
2021-04-14 5:58 ` [Nouveau] " Dan Carpenter
2021-04-19 15:30 ` Pierre Moreau
2021-04-19 15:30 ` Pierre Moreau
2021-04-19 15:30 ` Pierre Moreau
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.