From: Julia Lawall Date: Tue, 6 Sep 2016 14:51:15 +0000 (-0300) Subject: [media] vcodec: mediatek: fix odd_ptr_err.cocci warnings X-Git-Tag: v5.15~10718^2~1389 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa44d3b9e785327eef8182eae5ae7d463b9cbcba;p=platform%2Fkernel%2Flinux-starfive.git [media] vcodec: mediatek: fix odd_ptr_err.cocci warnings PTR_ERR should access the value just tested by IS_ERR Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci CC: Tiffany Lin Signed-off-by: Julia Lawall Signed-off-by: Fengguang Wu Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c index 70aa993..d48287c 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c @@ -255,7 +255,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev) } dev->reg_base[i] = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR((__force void *)dev->reg_base[i])) { - ret = PTR_ERR((__force void *)dev->reg_base); + ret = PTR_ERR((__force void *)dev->reg_base[i]); goto err_res; } mtk_v4l2_debug(2, "reg[%d] base=%p", i, dev->reg_base[i]);