summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2020-06-04 18:16:21 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-06-11 18:47:47 +0200
commita5047a3400d51c043a6501f960eefc8b102c9203 (patch)
tree62e734abf359ffc4a2afe94f9329463d5524c18c /drivers
parent84f1b2dc0c47b11aff3de1af237e8377e8bb7898 (diff)
downloadlinux-a5047a3400d51c043a6501f960eefc8b102c9203.tar.bz2
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c b/drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c
index c8649923b6b9..e06cf1883fc4 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) {