drm/atomic: free state in atomic ioctl if atomic commit failed
diff mbox

Message ID 1435224383.20491.6.camel@intel.com
State New
Headers show

Commit Message

Hong Liu June 25, 2015, 9:25 a.m. UTC
atomic commit only frees the state if no error met, caller needs to
free the allocated state if atomic commit failed.

Signed-off-by: Hong Liu <hong.liu@intel.com>

---
 drivers/gpu/drm/drm_atomic.c |    3 +++
 1 file changed, 3 insertions(+)

-- 
1.7.9.5

Comments

Maarten Lankhorst June 25, 2015, 9:56 a.m. UTC | #1
Hey,

Op 25-06-15 om 11:25 schreef Liu, Hong:
> atomic commit only frees the state if no error met, caller needs to
> free the allocated state if atomic commit failed.
>
> Signed-off-by: Hong Liu <hong.liu@intel.com>
> ---
>  drivers/gpu/drm/drm_atomic.c |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 6e3b78e..aa8ad4c 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -1344,6 +1344,9 @@ retry:
>  		}
>  	}
>  
> +	if (ret && !(arg->flags & DRM_MODE_ATOMIC_TEST_ONLY))
> +		goto fail;
> +
>  	drm_modeset_drop_locks(&ctx);
>  	drm_modeset_acquire_fini(&ctx);
"[PATCH 2/2] drm/atomic: Cleanup on error properly in the atomic ioctl." fixes it too.

~Maarten
Hong Liu June 26, 2015, 12:27 a.m. UTC | #2
On Thu, 2015-06-25 at 11:56 +0200, Maarten Lankhorst wrote:
> Hey,

> 

> Op 25-06-15 om 11:25 schreef Liu, Hong:

> > atomic commit only frees the state if no error met, caller needs to

> > free the allocated state if atomic commit failed.

> > 

> > Signed-off-by: Hong Liu <hong.liu@intel.com>

> > ---

> >  drivers/gpu/drm/drm_atomic.c |    3 +++

> >  1 file changed, 3 insertions(+)

> > 

> > diff --git a/drivers/gpu/drm/drm_atomic.c 

> > b/drivers/gpu/drm/drm_atomic.c

> > index 6e3b78e..aa8ad4c 100644

> > --- a/drivers/gpu/drm/drm_atomic.c

> > +++ b/drivers/gpu/drm/drm_atomic.c

> > @@ -1344,6 +1344,9 @@ retry:

> >  		}

> >  	}

> >  

> > +	if (ret && !(arg->flags & DRM_MODE_ATOMIC_TEST_ONLY))

> > +		goto fail;

> > +

> >  	drm_modeset_drop_locks(&ctx);

> >  	drm_modeset_acquire_fini(&ctx);

> "[PATCH 2/2] drm/atomic: Cleanup on error properly in the atomic 

> ioctl." fixes it too.


I didn't notice the patch, thanks for the reminder.

Thanks,
Hong

> 

> ~Maarten

Patch
diff mbox

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 6e3b78e..aa8ad4c 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1344,6 +1344,9 @@  retry:
 		}
 	}
 
+	if (ret && !(arg->flags & DRM_MODE_ATOMIC_TEST_ONLY))
+		goto fail;
+
 	drm_modeset_drop_locks(&ctx);
 	drm_modeset_acquire_fini(&ctx);