Skip to content

Commit

Permalink
V4L/DVB (13015): kmalloc failure ignored in m920x_firmware_download()
Browse files Browse the repository at this point in the history
Prevent NULL dereference if kmalloc() fails.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Roel Kluin authored and Mauro Carvalho Chehab committed Sep 19, 2009
1 parent 34e383d commit 1601fb1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/media/dvb/dvb-usb/m920x.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ static int m920x_firmware_download(struct usb_device *udev, const struct firmwar
int i, pass, ret = 0;

buff = kmalloc(65536, GFP_KERNEL);
if (buff == NULL)
return -ENOMEM;

if ((ret = m920x_read(udev, M9206_FILTER, 0x0, 0x8000, read, 4)) != 0)
goto done;
Expand Down

0 comments on commit 1601fb1

Please sign in to comment.