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:
parent
4911c5acf9
commit
54b4d1911e
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user