diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 3e49a0993191..67261ca03fbf 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -2924,8 +2924,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; }