Check properly that the allocated blob's pointer is valid.

Signed-off-by: Lionel Landwerlin <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Cc: Daniel Stone <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Matt Roper <[email protected]>
Cc: [email protected]
---
 drivers/gpu/drm/drm_atomic_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c 
b/drivers/gpu/drm/drm_atomic_helper.c
index 87d0b20..1caddb1 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2917,8 +2917,8 @@ void drm_atomic_helper_legacy_gamma_set(struct drm_crtc 
*crtc,
        blob = drm_property_create_blob(dev,
                                        sizeof(struct drm_color_lut) * size,
                                        NULL);
-       if (!blob) {
-               ret = -ENOMEM;
+       if (IS_ERR(blob)) {
+               ret = PTR_ERR(blob);
                goto fail;
        }
 
-- 
2.7.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to