All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/udl: Return correct error code on kmalloc failure
@ 2022-01-15 16:45 ` Harshit Mogalapalli
  0 siblings, 0 replies; 2+ messages in thread
From: Harshit Mogalapalli @ 2022-01-15 16:45 UTC (permalink / raw)
  Cc: harshit.m.mogalapalli, dan.carpenter, kernel-janitors,
	Dave Airlie, Sean Paul, Thomas Zimmermann, David Airlie,
	Daniel Vetter, Jani Nikula, Robert Tarasov, dri-devel,
	linux-kernel

-ENOMEM is correct error code to return on a memory allocation failure
instead of -1.

Smatch Warning:
drivers/gpu/drm/udl/udl_connector.c:27 udl_get_edid_block() warn:
returning -1 instead of -ENOMEM is sloppy

Fixes: a51143001d9e ("drm/udl: Refactor edid retrieving in UDL driver (v2)")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
---
 drivers/gpu/drm/udl/udl_connector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/udl/udl_connector.c b/drivers/gpu/drm/udl/udl_connector.c
index 930574ad2bca..b7a9c6d103ba 100644
--- a/drivers/gpu/drm/udl/udl_connector.c
+++ b/drivers/gpu/drm/udl/udl_connector.c
@@ -24,7 +24,7 @@ static int udl_get_edid_block(void *data, u8 *buf, unsigned int block,
 
 	read_buff = kmalloc(2, GFP_KERNEL);
 	if (!read_buff)
-		return -1;
+		return -ENOMEM;
 
 	for (i = 0; i < len; i++) {
 		int bval = (i + block * EDID_LENGTH) << 8;
-- 
2.27.0


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

* [PATCH] drm/udl: Return correct error code on kmalloc failure
@ 2022-01-15 16:45 ` Harshit Mogalapalli
  0 siblings, 0 replies; 2+ messages in thread
From: Harshit Mogalapalli @ 2022-01-15 16:45 UTC (permalink / raw)
  Cc: Robert Tarasov, Thomas Zimmermann, David Airlie, kernel-janitors,
	linux-kernel, dri-devel, Jani Nikula, harshit.m.mogalapalli,
	Dave Airlie, Sean Paul, dan.carpenter

-ENOMEM is correct error code to return on a memory allocation failure
instead of -1.

Smatch Warning:
drivers/gpu/drm/udl/udl_connector.c:27 udl_get_edid_block() warn:
returning -1 instead of -ENOMEM is sloppy

Fixes: a51143001d9e ("drm/udl: Refactor edid retrieving in UDL driver (v2)")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
---
 drivers/gpu/drm/udl/udl_connector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/udl/udl_connector.c b/drivers/gpu/drm/udl/udl_connector.c
index 930574ad2bca..b7a9c6d103ba 100644
--- a/drivers/gpu/drm/udl/udl_connector.c
+++ b/drivers/gpu/drm/udl/udl_connector.c
@@ -24,7 +24,7 @@ static int udl_get_edid_block(void *data, u8 *buf, unsigned int block,
 
 	read_buff = kmalloc(2, GFP_KERNEL);
 	if (!read_buff)
-		return -1;
+		return -ENOMEM;
 
 	for (i = 0; i < len; i++) {
 		int bval = (i + block * EDID_LENGTH) << 8;
-- 
2.27.0


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

end of thread, other threads:[~2022-01-17  8:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-15 16:45 [PATCH] drm/udl: Return correct error code on kmalloc failure Harshit Mogalapalli
2022-01-15 16:45 ` Harshit Mogalapalli

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.