Commit 54b4d191 authored by Ziyang Xuan's avatar Ziyang Xuan Committed by Mauro Carvalho Chehab

media: amphion: delete unnecessary NULL check

vfree(NULL) is safe. NULL check before vfree() is not needed.
Delete them to simplify the code.

Generated by coccinelle script:
	scripts/coccinelle/free/ifnullfree.cocci
Signed-off-by: default avatarZiyang Xuan <william.xuanziyang@huawei.com>
Reviewed-by: default avatarming_qian <ming.qian@nxp.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 4911c5ac
...@@ -1369,8 +1369,7 @@ static void vdec_cleanup(struct vpu_inst *inst) ...@@ -1369,8 +1369,7 @@ static void vdec_cleanup(struct vpu_inst *inst)
return; return;
vdec = inst->priv; vdec = inst->priv;
if (vdec) vfree(vdec);
vfree(vdec);
inst->priv = NULL; inst->priv = NULL;
vfree(inst); vfree(inst);
} }
......
...@@ -919,8 +919,7 @@ static void venc_cleanup(struct vpu_inst *inst) ...@@ -919,8 +919,7 @@ static void venc_cleanup(struct vpu_inst *inst)
return; return;
venc = inst->priv; venc = inst->priv;
if (venc) vfree(venc);
vfree(venc);
inst->priv = NULL; inst->priv = NULL;
vfree(inst); vfree(inst);
} }
......
...@@ -117,8 +117,7 @@ static void vpu_free_cmd(struct vpu_cmd_t *cmd) ...@@ -117,8 +117,7 @@ static void vpu_free_cmd(struct vpu_cmd_t *cmd)
{ {
if (!cmd) if (!cmd)
return; return;
if (cmd->pkt) vfree(cmd->pkt);
vfree(cmd->pkt);
vfree(cmd); vfree(cmd);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment