[PATCH] drm/vc4: perfmon: Fix variable dereferenced before check

José Expósito jose.exposito89 at gmail.com
Mon Jun 27 08:47:03 UTC 2022


Maxime Ripard wrote:
> Commit 30f8c74ca9b7 ("drm/vc4: Warn if some v3d code is run on BCM2711")
> introduced a check in vc4_perfmon_get() that dereferences a pointer before
> we checked whether that pointer is valid or not.
>
> Let's rework that function a bit to do things in the proper order.
>
> Reported-by: kernel test robot <lkp at intel.com>
> Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
> Fixes: 30f8c74ca9b7 ("drm/vc4: Warn if some v3d code is run on BCM2711")
> Signed-off-by: Maxime Ripard <maxime at cerno.tech>

Reviewed-by: José Expósito <jose.exposito89 at gmail.com>

I was about to send the same patch because Coverity reported this issue
today, but you already found and fixed it :D

Best wishes,
José Expósito



More information about the dri-devel mailing list