From mboxrd@z Thu Jan 1 00:00:00 1970 From: Felipe W Damasio Subject: [PATCH] Leak in vesafb Date: Mon, 06 Oct 2003 18:30:13 -0300 Sender: linux-kernel-owner@vger.kernel.org Message-ID: <3F81DEE5.9000600@terra.com.br> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080804060503020707040900" Return-path: List-Id: Cc: Linux Kernel Mailing List , linux-fbdev-devel@lists.sourceforge.net This is a multi-part message in MIME format. --------------080804060503020707040900 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi Andrew, Patch against 2.6.0-test6. Releases a previous request'ed_mem_region. Found by smatch. Since it didn't checked the return value of request_region, I'm not sure we should free it here...since (as it says on the driver), "vgacon probably has this region already". Andrew, I'd appreciate you could review this.. Thanks. Felipe --------------080804060503020707040900 Content-Type: text/plain; name="vesafb-leak.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="vesafb-leak.patch" --- linux-2.6.0-test6/drivers/video/vesafb.c.orig 2003-10-06 18:22:13.000000000 -0300 +++ linux-2.6.0-test6/drivers/video/vesafb.c 2003-10-06 18:23:35.000000000 -0300 @@ -366,8 +366,10 @@ fb_alloc_cmap(&fb_info.cmap, video_cmap_len, 0); - if (register_framebuffer(&fb_info)<0) + if (register_framebuffer(&fb_info)<0) { + release_mem_region(vesafb_fix.smem_start, vesafb_fix.smem_len); return -EINVAL; + } printk(KERN_INFO "fb%d: %s frame buffer device\n", fb_info.node, fb_info.fix.id); --------------080804060503020707040900--