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

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
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1369,7 +1369,6 @@ static void vdec_cleanup(struct vpu_inst *inst)
		return;

	vdec = inst->priv;
	if (vdec)
	vfree(vdec);
	inst->priv = NULL;
	vfree(inst);
+1 −2
Original line number Diff line number Diff line
@@ -919,7 +919,6 @@ static void venc_cleanup(struct vpu_inst *inst)
		return;

	venc = inst->priv;
	if (venc)
	vfree(venc);
	inst->priv = NULL;
	vfree(inst);
+1 −2
Original line number Diff line number Diff line
@@ -117,7 +117,6 @@ static void vpu_free_cmd(struct vpu_cmd_t *cmd)
{
	if (!cmd)
		return;
	if (cmd->pkt)
	vfree(cmd->pkt);
	vfree(cmd);
}