diff mbox series

[4/4] staging: atomisp: Check return value from compat_alloc_user_space

Message ID 20200604161621.9282-5-sakari.ailus@linux.intel.com
State New
Headers show
Series atomisp set_fs() fix | expand

Commit Message

Sakari Ailus June 4, 2020, 4:16 p.m. UTC
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c b/drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c
index c8649923b6b9e..e06cf1883fc4b 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c
@@ -863,6 +863,8 @@  static long atomisp_do_compat_ioctl(struct file *file,
 				 sizeof(struct atomisp_morph_table) +
 				 sizeof(struct atomisp_dis_coefficients) +
 				 sizeof(struct atomisp_dvs_6axis_config) : 0));
+	if (!karg)
+		return -ENOMEM;
 
 	/* First, convert the command. */
 	switch (cmd) {