From: Lionel Landwerlin Date: Thu, 10 Mar 2016 12:04:21 +0000 (+0000) Subject: drm: fix blob pointer check X-Git-Tag: Ubuntu-4.10.0-19.21~3701^2~10^2~2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=562c5b4d898613bec97f482098e7507f52c914cb;p=mirror_ubuntu-artful-kernel.git drm: fix blob pointer check Check properly that the allocated blob's pointer is valid. Signed-off-by: Lionel Landwerlin Reported-by: Dan Carpenter Cc: Daniel Stone Cc: Daniel Vetter Cc: Matt Roper Cc: dri-devel@lists.freedesktop.org Reviewed-by: Daniel Stone Fixes: 5488dc16fde7 ("drm: introduce pipe color correction properties") Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/1457611461-9116-1-git-send-email-lionel.g.landwerlin@intel.com --- 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; }