OSDN Git Service

media: staging: atomisp: Check return value from compat_alloc_user_space
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 4 Jun 2020 16:16:21 +0000 (18:16 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 11 Jun 2020 16:47:47 +0000 (18:47 +0200)
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>
drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.c

index c864992..e06cf18 100644 (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) {