diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-04-27 23:11:20 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 17:58:33 +0200 |
commit | 205161ed03b53c467dd669a340ea704ce0fb6f9e (patch) | |
tree | 790f1ccdaea41d0484528cb05b6efd2d05efb7a9 /drivers/media/dvb/dvb-usb/gp8psk.c | |
parent | V4L/DVB: dib3000mc: reduce large stack usage (diff) | |
download | linux-205161ed03b53c467dd669a340ea704ce0fb6f9e.tar.xz linux-205161ed03b53c467dd669a340ea704ce0fb6f9e.zip |
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>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/gp8psk.c')
-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 afb444db43ad..45106ac49674 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; |