Skip to content

Commit

Permalink
V4L/DVB: dvb-usb: gp8psk, fix potential null derefernce
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Slaby authored and Mauro Carvalho Chehab committed May 19, 2010
1 parent 0de8e35 commit 205161e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/media/dvb/dvb-usb/gp8psk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 205161e

Please sign in to comment.