Skip to contentSkip to conversation

drm/tilcdc: Fix hardcoded fail-return value in tilcdc_crtc_create()

PATCH Superseded Jyri Sarha 2 participants 3 messages Jan 31, 2017

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jyri Sarha

author
#0 lore raw

PATCH 1/1 drm/tilcdc: Fix hardcoded fail-return value in tilcdc_crtc_create()

Fix badly hardcoded return return value from under fail-label. All goto branches to the label set the "ret"-variable accordingly.

---
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tilcdc/tilcdc_crtc.c +1 -1
index 3a763f7..fa9fff3 100644
@@ -1027,5 +1027,5 @@ int tilcdc_crtc_create(struct drm_device *dev)
 
 fail:
 	tilcdc_crtc_destroy(crtc);
-	return -ENOMEM;
+	return -ret;
 }
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 13 lines · Jyri Sarha

Fix badly hardcoded return return value from under fail-label. All goto branches to the label set the "ret"-variable accordingly.

---
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tilcdc/tilcdc_crtc.c +0 -0
index 3a763f7..fa9fff3 100644

drivers/gpu/drm/tilcdc/tilcdc_crtc.c int tilcdc_crtc_create(struct drm_device *dev) · line 1030

Quoted 5 lines
drivers/gpu/drm/tilcdc/tilcdc_crtc.c +1 -1
@@ -1027,5 +1027,5 @@ int tilcdc_crtc_create(struct drm_device *dev)
 
 fail:
 	tilcdc_crtc_destroy(crtc);
-	return -ENOMEM;
+	return -ret;

Hi,

Shouldn't it read ret instead of -ret? The places that set ret already make it negative, while turning it positive looks like would fail the verification done by the caller.

Signature · 5 lines
Gabriel Krisman Bertazi
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#2 lore raw
Quoted 23 lines · Gabriel Krisman Bertazi
Quoted 13 lines · Jyri Sarha

Fix badly hardcoded return return value from under fail-label. All goto branches to the label set the "ret"-variable accordingly.

---
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/tilcdc/tilcdc_crtc.c +0 -0
index 3a763f7..fa9fff3 100644

drivers/gpu/drm/tilcdc/tilcdc_crtc.c int tilcdc_crtc_create(struct drm_device *dev) · line 1030

Quoted 5 lines
drivers/gpu/drm/tilcdc/tilcdc_crtc.c +1 -1
@@ -1027,5 +1027,5 @@ int tilcdc_crtc_create(struct drm_device *dev)
 
 fail:
 	tilcdc_crtc_destroy(crtc);
-	return -ENOMEM;
+	return -ret;

Hi,

Quoted 4 lines

Shouldn't it read ret instead of -ret? The places that set ret already make it negative, while turning it positive looks like would fail the verification done by the caller.

Argh.. sorry. I fixed it already in my branch but forgot to format the patch again... I'll do another version.

Thanks,
Jyro
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel