Skip to content

Commit

Permalink
pnp: avoid a small unlikely memory leak in proc_read_escd()
Browse files Browse the repository at this point in the history
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: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jesper Juhl authored and Linus Torvalds committed Oct 17, 2007
1 parent 5f149cf commit a8b0ac0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/pnp/pnpbios/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ static int proc_read_escd(char *buf, char **start, off_t pos,

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

Expand Down

0 comments on commit a8b0ac0

Please sign in to comment.