Message ID | 1457611461-9116-1-git-send-email-lionel.g.landwerlin@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 10 March 2016 at 12:04, Lionel Landwerlin <lionel.g.landwerlin@intel.com> wrote: > Check properly that the allocated blob's pointer is valid. > > Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> > Reported-by: Dan Carpenter <dan.carpenter@oracle.com> > Cc: Daniel Stone <daniels@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
On Thu, Mar 10, 2016 at 12:10:30PM +0000, Daniel Stone wrote: > On 10 March 2016 at 12:04, Lionel Landwerlin > <lionel.g.landwerlin@intel.com> wrote: > > Check properly that the allocated blob's pointer is valid. > > > > Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> > > Reported-by: Dan Carpenter <dan.carpenter@oracle.com> > > Cc: Daniel Stone <daniels@collabora.com> > > Reviewed-by: Daniel Stone <daniels@collabora.com> Applied to drm-misc, thanks. -Daniel
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; }
Check properly that the allocated blob's pointer is valid. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Daniel Stone <daniels@collabora.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Matt Roper <matthew.d.roper@intel.com> Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)