From: Sakari Ailus Date: Thu, 4 Jun 2020 16:16:21 +0000 (+0200) Subject: media: staging: atomisp: Check return value from compat_alloc_user_space X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a5047a3400d51c043a6501f960eefc8b102c9203;p=linux.git media: staging: atomisp: Check return value from compat_alloc_user_space If something gets wrong, return, instead of trying to convert from a NULL pointer. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- 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) {