imx-drm: imx-drm-core: fix error cleanup path for imx_drm_add_crtc()
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 16 Dec 2013 11:33:24 +0000 (11:33 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Dec 2013 01:09:51 +0000 (17:09 -0800)
imx_drm_add_crtc() was kfree'ing the imx_drm_crtc structure while
leaving it on the list of CRTCs.  Delete it from the list first.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/imx-drm/imx-drm-core.c

index 6bd015ac9d683474a034924f8ffec3e752e1d382..b5ff45f3c55b60fe9ba44e59300bbf1335e09931 100644 (file)
@@ -528,6 +528,7 @@ int imx_drm_add_crtc(struct drm_crtc *crtc,
        return 0;
 
 err_register:
+       list_del(&imx_drm_crtc->list);
        kfree(imx_drm_crtc);
 err_alloc:
 err_busy: