[PATCH 1/2] media: mediatek: vcodec: Delete null pointer checks in vdec_vp9_slice_single_decode()

Markus Elfring Markus.Elfring at web.de
Mon Apr 17 05:41:57 PDT 2023


Date: Mon, 17 Apr 2023 13:43:31 +0200

Extra null pointer checks became unwanted for
the input parameter validation in the implementation of
the function “vdec_vp9_slice_single_decode”.
Thus omit an if statement at the beginning.

Link: https://lore.kernel.org/kernel-janitors/0341924c-7f0a-28aa-eeae-f7de69ab36d8@xs4all.nl/
Signed-off-by: Markus Elfring <elfring at users.sourceforge.net>
---
 .../media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c   | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c b/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c
index cf16cf2807f0..8430098ed0b1 100644
--- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c
+++ b/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c
@@ -1995,8 +1995,6 @@ static int vdec_vp9_slice_single_decode(void *h_vdec, struct mtk_vcodec_mem *bs,
 	struct mtk_vcodec_ctx *ctx;
 	int ret;

-	if (!instance || !instance->ctx)
-		return -EINVAL;
 	ctx = instance->ctx;

 	/* bs NULL means flush decoder */
--
2.40.0




More information about the Linux-mediatek mailing list