Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8b0ac08 authored by Jesper Juhl's avatar Jesper Juhl Committed by Linus Torvalds
Browse files

pnp: avoid a small unlikely memory leak in proc_read_escd()



There's a small and unlikely memory leak in
drivers/pnp/pnpbios/proc.c::proc_read_escd().  It's inside a sanity check,
so it probably won't trigger often (if at all), however it *is* a potential
leak and it's easy to avoid, so let's just fix it :)

Signed-off-by: default avatarJesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5f149cf0
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -94,8 +94,9 @@ static int proc_read_escd(char *buf, char **start, off_t pos,


	/* sanity check */
	/* sanity check */
	if (escd_size > MAX_SANE_ESCD_SIZE) {
	if (escd_size > MAX_SANE_ESCD_SIZE) {
		printk(KERN_ERR
		printk(KERN_ERR "PnPBIOS: proc_read_escd: ESCD size reported by"
		       "PnPBIOS: proc_read_escd: ESCD size reported by BIOS read_escd call is too great\n");
				" BIOS read_escd call is too great\n");
		kfree(tmpbuf);
		return -EFBIG;
		return -EFBIG;
	}
	}