All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/v3d: fix a NULL vs error pointer mixup
@ 2019-03-21  6:27 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2019-03-21  6:27 UTC (permalink / raw)
  To: Eric Anholt; +Cc: David Airlie, kernel-janitors, dri-devel

The drm_gem_shmem_create() returns error pointers and v3d_bo_create() is
also supposed to return error pointers.

Fixes: 40609d4820b2 ("drm/v3d: Use the new shmem helpers to reduce driver boilerplate.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/v3d/v3d_bo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/v3d/v3d_bo.c b/drivers/gpu/drm/v3d/v3d_bo.c
index c0219ebb4284..a22b75a3a533 100644
--- a/drivers/gpu/drm/v3d/v3d_bo.c
+++ b/drivers/gpu/drm/v3d/v3d_bo.c
@@ -130,8 +130,8 @@ struct v3d_bo *v3d_bo_create(struct drm_device *dev, struct drm_file *file_priv,
 	int ret;
 
 	shmem_obj = drm_gem_shmem_create(dev, unaligned_size);
-	if (!shmem_obj)
-		return NULL;
+	if (IS_ERR(shmem_obj))
+		return ERR_CAST(shmem_obj);
 	bo = to_v3d_bo(&shmem_obj->base);
 
 	ret = v3d_bo_create_finish(&shmem_obj->base);
-- 
2.17.1

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

* [PATCH] drm/v3d: fix a NULL vs error pointer mixup
@ 2019-03-21  6:27 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2019-03-21  6:27 UTC (permalink / raw)
  To: Eric Anholt; +Cc: David Airlie, kernel-janitors, dri-devel

The drm_gem_shmem_create() returns error pointers and v3d_bo_create() is
also supposed to return error pointers.

Fixes: 40609d4820b2 ("drm/v3d: Use the new shmem helpers to reduce driver boilerplate.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/v3d/v3d_bo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/v3d/v3d_bo.c b/drivers/gpu/drm/v3d/v3d_bo.c
index c0219ebb4284..a22b75a3a533 100644
--- a/drivers/gpu/drm/v3d/v3d_bo.c
+++ b/drivers/gpu/drm/v3d/v3d_bo.c
@@ -130,8 +130,8 @@ struct v3d_bo *v3d_bo_create(struct drm_device *dev, struct drm_file *file_priv,
 	int ret;
 
 	shmem_obj = drm_gem_shmem_create(dev, unaligned_size);
-	if (!shmem_obj)
-		return NULL;
+	if (IS_ERR(shmem_obj))
+		return ERR_CAST(shmem_obj);
 	bo = to_v3d_bo(&shmem_obj->base);
 
 	ret = v3d_bo_create_finish(&shmem_obj->base);
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/v3d: fix a NULL vs error pointer mixup
  2019-03-21  6:27 ` Dan Carpenter
@ 2019-03-22 21:30   ` Eric Anholt
  -1 siblings, 0 replies; 4+ messages in thread
From: Eric Anholt @ 2019-03-22 21:30 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: David Airlie, kernel-janitors, dri-devel

[-- Attachment #1: Type: text/plain, Size: 397 bytes --]

Dan Carpenter <dan.carpenter@oracle.com> writes:

> The drm_gem_shmem_create() returns error pointers and v3d_bo_create() is
> also supposed to return error pointers.
>
> Fixes: 40609d4820b2 ("drm/v3d: Use the new shmem helpers to reduce driver boilerplate.")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Sigh, error pointers are the worst.

Reviewed, and applying to drm-misc-next.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: [PATCH] drm/v3d: fix a NULL vs error pointer mixup
@ 2019-03-22 21:30   ` Eric Anholt
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Anholt @ 2019-03-22 21:30 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: David Airlie, kernel-janitors, dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 397 bytes --]

Dan Carpenter <dan.carpenter@oracle.com> writes:

> The drm_gem_shmem_create() returns error pointers and v3d_bo_create() is
> also supposed to return error pointers.
>
> Fixes: 40609d4820b2 ("drm/v3d: Use the new shmem helpers to reduce driver boilerplate.")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Sigh, error pointers are the worst.

Reviewed, and applying to drm-misc-next.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2019-03-22 21:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21  6:27 [PATCH] drm/v3d: fix a NULL vs error pointer mixup Dan Carpenter
2019-03-21  6:27 ` Dan Carpenter
2019-03-22 21:30 ` Eric Anholt
2019-03-22 21:30   ` Eric Anholt

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.