Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1601fb14 authored by Roel Kluin's avatar Roel Kluin Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (13015): kmalloc failure ignored in m920x_firmware_download()



Prevent NULL dereference if kmalloc() fails.

Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 34e383dd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;