aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2010-04-27 17:11:20 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:58:33 -0400
commit205161ed03b53c467dd669a340ea704ce0fb6f9e (patch)
tree790f1ccdaea41d0484528cb05b6efd2d05efb7a9 /drivers/media
parent0de8e3533e08745616a30bdb3fa5106c85083e51 (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>
Diffstat (limited to 'drivers/media')
-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)
105 105
106 ptr = fw->data; 106 ptr = fw->data;
107 buf = kmalloc(64, GFP_KERNEL | GFP_DMA); 107 buf = kmalloc(64, GFP_KERNEL | GFP_DMA);
108 if (!buf) {
109 ret = -ENOMEM;
110 goto out_rel_fw;
111 }
108 112
109 while (ptr[0] != 0xff) { 113 while (ptr[0] != 0xff) {
110 u16 buflen = ptr[0] + 4; 114 u16 buflen = ptr[0] + 4;