[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1268751086-14003-1-git-send-email-jslaby@suse.cz>
Date: Tue, 16 Mar 2010 15:51:26 +0100
From: Jiri Slaby <jslaby@...e.cz>
To: mchehab@...radead.org
Cc: linux-kernel@...r.kernel.org, jirislaby@...il.com,
Alan Nisota <alannisota@...il.com>,
Patrick Boettcher <pb@...uxtv.org>
Subject: [PATCH 1/1] DVB-USB: gp8psk, fix potential null derefernce
Stanse found that in gp8psk_load_bcm4500fw there is missing a check for
return value of kmalloc. Add one and bail out appropriatelly.
Signed-off-by: Jiri Slaby <jslaby@...e.cz>
Cc: Alan Nisota <alannisota@...il.com>
Cc: Patrick Boettcher <pb@...uxtv.org>
Cc: Mauro Carvalho Chehab <mchehab@...radead.org>
---
drivers/media/dvb/dvb-usb/gp8psk.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/media/dvb/dvb-usb/gp8psk.c b/drivers/media/dvb/dvb-usb/gp8psk.c
index afb444d..45106ac 100644
--- a/drivers/media/dvb/dvb-usb/gp8psk.c
+++ b/drivers/media/dvb/dvb-usb/gp8psk.c
@@ -105,6 +105,10 @@ static int gp8psk_load_bcm4500fw(struct dvb_usb_device *d)
ptr = fw->data;
buf = kmalloc(64, GFP_KERNEL | GFP_DMA);
+ if (!buf) {
+ ret = -ENOMEM;
+ goto out_rel_fw;
+ }
while (ptr[0] != 0xff) {
u16 buflen = ptr[0] + 4;
--
1.7.0.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists