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 <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Sakari Ailus 2020-06-04 18:16:21 +02:00 committed by Mauro Carvalho Chehab
parent 84f1b2dc0c
commit a5047a3400
1 changed files with 2 additions and 0 deletions

View File

@ -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) {