summaryrefslogtreecommitdiff
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2010-04-27 18:11:20 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 12:58:33 -0300
commit205161ed03b53c467dd669a340ea704ce0fb6f9e (patch)
tree790f1ccdaea41d0484528cb05b6efd2d05efb7a9 /drivers/media/dvb
parent0de8e3533e08745616a30bdb3fa5106c85083e51 (diff)
downloadlinux-riscv-205161ed03b53c467dd669a340ea704ce0fb6f9e.tar.gz
linux-riscv-205161ed03b53c467dd669a340ea704ce0fb6f9e.tar.bz2
linux-riscv-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')
-rw-r--r--drivers/media/dvb/dvb-usb/gp8psk.c4
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;