diff mbox

drm: atomic helper: do not unreference error pointer

Message ID 1457698646-22231-1-git-send-email-lionel.g.landwerlin@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lionel Landwerlin March 11, 2016, 12:17 p.m. UTC
562c5b4d8986 didn't quite fix the issue of dealing with an error
pointer. We can't free/unref an error pointer so reset it to NULL.

Many thanks to Dan Carpenter for pointing this out again.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: 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
Fixes: 562c5b4d8986 ("drm: fix blob pointer check")
---
 drivers/gpu/drm/drm_atomic_helper.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Daniel Vetter March 13, 2016, 6:40 p.m. UTC | #1
On Fri, Mar 11, 2016 at 12:17:26PM +0000, Lionel Landwerlin wrote:
> 562c5b4d8986 didn't quite fix the issue of dealing with an error
> pointer. We can't free/unref an error pointer so reset it to NULL.
> 
> Many thanks to Dan Carpenter for pointing this out again.
> 
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> Cc: 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
> Fixes: 562c5b4d8986 ("drm: fix blob pointer check")

Applied to drm-misc. Also I guess I've run out of my quota of silly stuff
I merge pretty fast ... ;-)

Cheers, Daniel
> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 892de99..2bb90fa 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -2926,6 +2926,7 @@ void drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
>  					NULL);
>  	if (IS_ERR(blob)) {
>  		ret = PTR_ERR(blob);
> +		blob = NULL;
>  		goto fail;
>  	}
>  
> -- 
> 2.7.0
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 892de99..2bb90fa 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2926,6 +2926,7 @@  void drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
 					NULL);
 	if (IS_ERR(blob)) {
 		ret = PTR_ERR(blob);
+		blob = NULL;
 		goto fail;
 	}