do_mounts memory leak
PATCH 1/1 do_mounts memory leak
Hi,
The Stanford Checker identified a memory leak in init/do_mounts.c. This patch to 2.5.59 corrects it. Please apply.
Thanks,
~Randy
init/do_mounts.c renamed from init/do_mounts.c%LEAK +6 -6
@@ -653,12 +653,6 @@/* * OK, time to copy in the data */ - buf =kmalloc (BLOCK_SIZE ,GFP_KERNEL ); -if (buf ==0 ) { -printk (KERN_ERR "RAMDISK: could not allocate buffer\n" ); - goto done; - } -if (sys_ioctl (in_fd,BLKGETSIZE , (unsigned long )&devblocks) <0 ) devblocks =0 ;else
@@ -669,6 +663,12 @@if (devblocks ==0 ) {printk (KERN_ERR "RAMDISK: could not determine device size\n" ); + goto done; + } + + buf =kmalloc (BLOCK_SIZE ,GFP_KERNEL ); +if (buf ==0 ) { +printk (KERN_ERR "RAMDISK: could not allocate buffer\n" ); goto done; }