From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomi Valkeinen Date: Wed, 08 Jan 2014 09:53:06 +0000 Subject: Re: [PATCH] fbcon: Fix memory leak in fbcon_exit(). Message-Id: <52CD2002.30208@ti.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="HU8lGjTU08sgF4fotpiPFdbvaDGHqlkwU" List-Id: References: <1387982857-14500-1-git-send-email-masami256@gmail.com> In-Reply-To: <1387982857-14500-1-git-send-email-masami256@gmail.com> To: Masami Ichikawa Cc: plagnioj@jcrosoft.com, linux-fbdev@vger.kernel.org, airlied@redhat.com, udknight@gmail.com, gregkh@linuxfoundation.org, akpm@linux-foundation.org, tiwai@suse.de, linux-kernel@vger.kernel.org --HU8lGjTU08sgF4fotpiPFdbvaDGHqlkwU Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2013-12-25 16:47, Masami Ichikawa wrote: > kmemleak reported a memory leak as below. >=20 > unreferenced object 0xffff880036ca84c0 (size 16): > comm "swapper/0", pid 1, jiffies 4294877407 (age 4434.633s) > hex dump (first 16 bytes): > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ................ > backtrace: > [] kmemleak_alloc+0x4e/0xb0 > [] __kmalloc+0x1fc/0x290 > [] bit_cursor+0x24e/0x6c0 > [] fbcon_cursor+0x154/0x1d0 > [] hide_cursor+0x28/0xa0 > [] update_region+0x6f/0x90 > [] fbcon_switch+0x518/0x550 > [] redraw_screen+0x189/0x240 > [] do_bind_con_driver+0x360/0x380 > [] do_take_over_console+0x114/0x1c0 > [] do_fbcon_takeover+0x63/0xd0 > [] fbcon_event_notify+0x605/0x720 > [] notifier_call_chain+0x4c/0x70 > [] __blocking_notifier_call_chain+0x4d/0x70 > [] blocking_notifier_call_chain+0x16/0x20 > [] fb_notifier_call_chain+0x1b/0x20 >=20 > In this case ops->cursor_state.mask is allocated in bit_cursor() but > not freed in fbcon_exit(). So, fbcon_exit() needs to free buffer in its= > process. > In the case, fbcon_exit() was called from fbcon_deinit() when driver > called remove_conflicting_framebuffers(). >=20 > Signed-off-by: Masami Ichikawa > --- > drivers/video/console/fbcon.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbco= n.c > index cd8a802..4f02375 100644 > --- a/drivers/video/console/fbcon.c > +++ b/drivers/video/console/fbcon.c > @@ -3561,6 +3561,7 @@ static void fbcon_exit(void) > =20 > fbcon_del_cursor_timer(info); > kfree(ops->cursor_src); > + kfree(ops->cursor_state.mask); > kfree(info->fbcon_par); > info->fbcon_par =3D NULL; > } >=20 Thanks, queued for 3.14. Tomi --HU8lGjTU08sgF4fotpiPFdbvaDGHqlkwU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJSzSACAAoJEPo9qoy8lh71PRwQALA5pqu/fR5Mb2VE9RQG0CDa Z2YlZJuHjBsjjj/PVG5mZAsBuLHfctPhh9UqrK8UNdE0lEBR7jE7hAKX5OrizZ2z Pe+qqBFcexQbHz0EpafSHyF+31fTaE5BwruBMbTqN16m7odyM1r1QjAUEcixVHUl /QMgk5KHIWirkLZh4X42uKBDpCh1jmORLRoYWddhquLhngnuisdZY4unyanU4bEb Ly3HLl4XGFDW6IjgSXNTaKJMPxowPqX9wAAaeq41X103btV1JGvLa1gwm3AEPI2M kvGSrRgKrPdQJIvh0Yv+c7MxUn90N2XlEvj4VaMqtnzuUtiEMyIa7NOc9F1YMX66 RKg18riAKvRyjErkCuSDEQTRgky2OMtd17Mpn9ui3QitlX7mD0nxau/bdq7vGudA grJoTwLMAAAnm3QZy/lb7DVVilldbAQkTmS+tsuCNppIa1QlvXCVYYehrCJf7qgU JQv2UCfEkSiWrnXPfKs2kxUdJLi9yfCJ8Jh4d+7WjvoMkANeHi/A+6TQ46NkDSF1 /oWL07D8Xyccpr3RDdbwishINZDO8VAqaWJEsJ59bk3oyO8BOmjdLKFZkQe45WGl SDC4cTqkOjEEa2dMuVTHlmdbUtoW3cHcDpXrOqBZHBemdKmKmsY/kCOG2A+lzHQx bTVMQCNL7xnuQu1FK7bb =QniR -----END PGP SIGNATURE----- --HU8lGjTU08sgF4fotpiPFdbvaDGHqlkwU--