--- zzzz-none-000/linux-3.10.107/drivers/gpu/drm/shmobile/shmob_drm_plane.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/gpu/drm/shmobile/shmob_drm_plane.c 2021-02-04 17:41:59.000000000 +0000 @@ -1,7 +1,7 @@ /* * shmob_drm_plane.c -- SH Mobile DRM Planes * - * Copyright (C) 2012 Renesas Corporation + * Copyright (C) 2012 Renesas Electronics Corporation * * Laurent Pinchart (laurent.pinchart@ideasonboard.com) * @@ -166,7 +166,7 @@ { struct shmob_drm_plane *splane = to_shmob_plane(plane); - if (plane->fb == NULL || !plane->enabled) + if (plane->fb == NULL) return; __shmob_drm_plane_setup(splane, plane->fb); @@ -221,11 +221,8 @@ static void shmob_drm_plane_destroy(struct drm_plane *plane) { - struct shmob_drm_plane *splane = to_shmob_plane(plane); - shmob_drm_plane_disable(plane); drm_plane_cleanup(plane); - kfree(splane); } static const struct drm_plane_funcs shmob_drm_plane_funcs = { @@ -251,7 +248,7 @@ struct shmob_drm_plane *splane; int ret; - splane = kzalloc(sizeof(*splane), GFP_KERNEL); + splane = devm_kzalloc(sdev->dev, sizeof(*splane), GFP_KERNEL); if (splane == NULL) return -ENOMEM; @@ -261,8 +258,6 @@ ret = drm_plane_init(sdev->ddev, &splane->plane, 1, &shmob_drm_plane_funcs, formats, ARRAY_SIZE(formats), false); - if (ret < 0) - kfree(splane); return ret; }