]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] vcodec: mediatek: fix odd_ptr_err.cocci warnings
authorJulia Lawall <Julia.Lawall@lip6.fr>
Tue, 6 Sep 2016 14:51:15 +0000 (11:51 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 21 Oct 2016 14:09:32 +0000 (12:09 -0200)
PTR_ERR should access the value just tested by IS_ERR

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

CC: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c

index 70aa99329ce598a15ef3a2788f27320069fe58d3..d48287c727f4f7e418f935bdad91c2f03a7daf73 100644 (file)
@@ -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]);