diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-04-27 18:11:20 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 12:58:33 -0300 |
commit | 205161ed03b53c467dd669a340ea704ce0fb6f9e (patch) | |
tree | 790f1ccdaea41d0484528cb05b6efd2d05efb7a9 | |
parent | 0de8e3533e08745616a30bdb3fa5106c85083e51 (diff) |
V4L/DVB: 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@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | 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 afb444db43a..45106ac4967 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; |