[PATCH] init/do_mounts_rd.c memory leak

Hollis Blanchard (hollis@austin.ibm.com)
Fri, 23 May 2003 14:12:42 -0500


--Apple-Mail-18-248034566
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed

Another potential memory leak the Stanford checker caught at 2.5.48:
while closing and opening floppy disks, buf could be allocated and
never freed.

-- 
Hollis Blanchard
IBM Linux Technology Center

--Apple-Mail-18-248034566 Content-Disposition: attachment; filename=mount-rd-free.diff Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name="mount-rd-free.diff"

--- init/do_mounts_rd.c.orig 2003-05-15 15:05:56.000000000 -0500 +++ init/do_mounts_rd.c 2003-05-15 15:06:30.000000000 -0500 @@ -206,12 +206,14 @@ rotate = 0; if (close(in_fd)) { printk("Error closing the disk.\n"); + kfree(buf); goto noclose_input; } change_floppy("disk #%d", disk); in_fd = open(from, O_RDONLY, 0); if (in_fd < 0) { printk("Error opening disk.\n"); + kfree(buf); goto noclose_input; } printk("Loading disk #%d... ", disk);

--Apple-Mail-18-248034566--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/