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: Ziyang Xuan <william.xuanziyang@huawei.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
Ziyang Xuan 2022-06-06 14:10:42 +01:00 committed by Mauro Carvalho Chehab
parent 4911c5acf9
commit 54b4d1911e
3 changed files with 3 additions and 6 deletions

View File

@ -1369,8 +1369,7 @@ static void vdec_cleanup(struct vpu_inst *inst)
return;
vdec = inst->priv;
if (vdec)
vfree(vdec);
vfree(vdec);
inst->priv = NULL;
vfree(inst);
}

View File

@ -919,8 +919,7 @@ static void venc_cleanup(struct vpu_inst *inst)
return;
venc = inst->priv;
if (venc)
vfree(venc);
vfree(venc);
inst->priv = NULL;
vfree(inst);
}

View File

@ -117,8 +117,7 @@ static void vpu_free_cmd(struct vpu_cmd_t *cmd)
{
if (!cmd)
return;
if (cmd->pkt)
vfree(cmd->pkt);
vfree(cmd->pkt);
vfree(cmd);
}