media: atomisp: remove redundant NULL check
authorYang Li <abaci-bugfix@linux.alibaba.com>
Thu, 21 Jan 2021 08:28:51 +0000 (09:28 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 23 Mar 2021 07:52:07 +0000 (08:52 +0100)
Fix below warnings reported by coccicheck:
./drivers/staging/media/atomisp/pci/sh_css_params.c:1575:2-8: WARNING:
NULL check before some freeing functions is not needed.
./drivers/staging/media/atomisp/pci/sh_css_params.c:3006:2-8: WARNING:
NULL check before some freeing functions is not needed.

Link: https://lore.kernel.org/linux-media/1611217731-56866-1-git-send-email-abaci-bugfix@linux.alibaba.com
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <abaci-bugfix@linux.alibaba.com>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/atomisp/pci/sh_css_params.c

index 74672564ec006529d91558489e34539a5eb84613..644e1457598746ffc66f92a850e63aa482c9ed03 100644 (file)
@@ -1575,8 +1575,7 @@ ia_css_isp_3a_statistics_map_allocate(
        return me;
 
 err:
-       if (me)
-               kvfree(me);
+       kvfree(me);
        return NULL;
 }
 
@@ -3006,8 +3005,7 @@ ia_css_stream_isp_parameters_uninit(struct ia_css_stream *stream)
        }
 
        kvfree(params);
-       if (per_frame_params)
-               kvfree(per_frame_params);
+       kvfree(per_frame_params);
        stream->isp_params_configs = NULL;
        stream->per_frame_isp_params_configs = NULL;