Re: drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c:72:6-12: inconsistent IS_ERR and PTR_ERR on line 73.
From: Laurent Pinchart
Date: Tue Oct 06 2026 - 06:22:24 EST
On Tue, Oct 06, 2026 at 11:14:09AM +0200, Luca Ceresoli wrote:
> On Tue Oct 6, 2026 at 8:40 AM CEST, kernel test robot wrote:
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head: 2c3418fffa9d037b2038a6db48be63f9e2291806
> > commit: 5b03d4907db93627ef48396f39c3455ce644c946 drm: rcar-du: encoder: convert to of_drm_find_and_get_bridge()
> > date: 6 months ago
> > config: sparc64-randconfig-r2106-20261005 (https://download.01.org/0day-ci/archive/20261006/202610060853.t5Q4BX8P-lkp@xxxxxxxxx/config)
> > compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 195c81658995a4b7531c30a12c5aef6cf2bbd671)
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Fixes: 5b03d4907db9 ("drm: rcar-du: encoder: convert to of_drm_find_and_get_bridge()")
> > | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202610060853.t5Q4BX8P-lkp@xxxxxxxxx/
> >
> > cocci warnings: (new ones prefixed by >>)
> >>> drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c:72:6-12: inconsistent IS_ERR and PTR_ERR on line 73.
>
> ...
>
> > 9a248605980a75 drivers/gpu/drm/rcar-du/rcar_du_encoder.c Laurent Pinchart 2020-12-03 @72 if (IS_ERR(bridge))
> > 5b03d4907db936 drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c Luca Ceresoli 2026-04-09 @73 return PTR_ERR(no_free_ptr(bridge));
>
> This looks like a false positive to me. I guess this code would not trigger
> any warning without the infixed no_free_ptr(). But no_free_ptr(p) is
> transparent in the sense that it returns a copy of p.
>
> So I guess no fix is needed for this driver. Just let me know in case I'm
> wrong.
That's my understanding too. The coccinelle semantic patch probably
needs an update.
--
Regards,
Laurent Pinchart