From: Jesper Juhl Date: Wed, 17 Oct 2007 06:26:56 +0000 (-0700) Subject: pnp: avoid a small unlikely memory leak in proc_read_escd() X-Git-Tag: v2.6.24-rc1~710 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=a8b0ac0873cd911b3bf3d6e2db98f80d0b158d56;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/pnp/pnpbios/proc.c b/drivers/pnp/pnpbios/proc.c index 9d9841f24a8..bb19bc957ba 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, /* 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; }