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

Commit d49d0e39 authored by Kulikov Vasiliy's avatar Kulikov Vasiliy Committed by Greg Kroah-Hartman
Browse files

staging: otus: check kmalloc() return value



kmalloc() may fail, if so return error from zfwUsbSubmitControl().

Signed-off-by: default avatarKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 94f5659c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -104,6 +104,11 @@ u32_t zfwUsbSubmitControl(zdev_t *dev, u8_t req, u16_t value, u16_t index,

	if (size > 0) {
		buf = kmalloc(size, GFP_KERNEL);
		if (buf == NULL) {
			pr_err("zfwUsbSubmitControl() failed, "
				  "kmalloc() returned NULL\n");
			return 1;
		}
		memcpy(buf, (u8_t *)data, size);
	} else
		buf = NULL;