aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2007-10-17 02:26:56 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 11:42:51 -0400
commita8b0ac0873cd911b3bf3d6e2db98f80d0b158d56 (patch)
tree4518c45d295a8668e768a648f6fc5cc71f9d9878
parent5f149cf0ac2ba6c23d77e39fe03290535d13f13d (diff)
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: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/pnp/pnpbios/proc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pnp/pnpbios/proc.c b/drivers/pnp/pnpbios/proc.c
index 9d9841f24a85..bb19bc957bad 100644
--- a/drivers/pnp/pnpbios/proc.c
+++ b/drivers/pnp/pnpbios/proc.c
@@ -94,8 +94,9 @@ static int proc_read_escd(char *buf, char **start, off_t pos,
94 94
95 /* sanity check */ 95 /* sanity check */
96 if (escd_size > MAX_SANE_ESCD_SIZE) { 96 if (escd_size > MAX_SANE_ESCD_SIZE) {
97 printk(KERN_ERR 97 printk(KERN_ERR "PnPBIOS: proc_read_escd: ESCD size reported by"
98 "PnPBIOS: proc_read_escd: ESCD size reported by BIOS read_escd call is too great\n"); 98 " BIOS read_escd call is too great\n");
99 kfree(tmpbuf);
99 return -EFBIG; 100 return -EFBIG;
100 } 101 }
101 102