Message ID | 1372665647-13749-1-git-send-email-sw0312.kim@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Nice catch!!!. Applied. Thanks, Inki Dae 2013/7/1 Seung-Woo Kim <sw0312.kim@samsung.com>: > From: YoungJun Cho <yj44.cho@samsung.com> > > When the exynos_drm_subdrv_open() returns error, the file_priv > should be released and file->driver_priv set to NULL. > > Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> > --- > drivers/gpu/drm/exynos/exynos_drm_drv.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c > index 2762373..ca2729a 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c > @@ -155,6 +155,7 @@ static int exynos_drm_unload(struct drm_device *dev) > static int exynos_drm_open(struct drm_device *dev, struct drm_file *file) > { > struct drm_exynos_file_private *file_priv; > + int ret; > > file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL); > if (!file_priv) > @@ -162,7 +163,13 @@ static int exynos_drm_open(struct drm_device *dev, struct drm_file *file) > > file->driver_priv = file_priv; > > - return exynos_drm_subdrv_open(dev, file); > + ret = exynos_drm_subdrv_open(dev, file); > + if (ret) { > + kfree(file_priv); > + file->driver_priv = NULL; > + } > + > + return ret; > } > > static void exynos_drm_preclose(struct drm_device *dev, > -- > 1.7.9.5 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 2762373..ca2729a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -155,6 +155,7 @@ static int exynos_drm_unload(struct drm_device *dev) static int exynos_drm_open(struct drm_device *dev, struct drm_file *file) { struct drm_exynos_file_private *file_priv; + int ret; file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL); if (!file_priv) @@ -162,7 +163,13 @@ static int exynos_drm_open(struct drm_device *dev, struct drm_file *file) file->driver_priv = file_priv; - return exynos_drm_subdrv_open(dev, file); + ret = exynos_drm_subdrv_open(dev, file); + if (ret) { + kfree(file_priv); + file->driver_priv = NULL; + } + + return ret; } static void exynos_drm_preclose(struct drm_device *dev,