From 49cbf78b4386e4d4519cb6cd76af2b4c2bb8e395 Mon Sep 17 00:00:00 2001 From: Douglas Schilling Landgraf Date: Fri, 18 Sep 2009 20:09:52 -0300 Subject: kmalloc failure ignored in m920x_firmware_download() From: Roel Kluin Prevent NULL dereference if kmalloc() fails. Priority: normal Signed-off-by: Roel Kluin Signed-off-by: Douglas Schilling Landgraf --- linux/drivers/media/dvb/dvb-usb/m920x.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux/drivers') diff --git a/linux/drivers/media/dvb/dvb-usb/m920x.c b/linux/drivers/media/dvb/dvb-usb/m920x.c index 55d2bb8f6..0a686adec 100644 --- a/linux/drivers/media/dvb/dvb-usb/m920x.c +++ b/linux/drivers/media/dvb/dvb-usb/m920x.c @@ -340,6 +340,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; -- cgit v1.2.3