Re: [PATCH] drm/vc4: fix dereference before NULL check
From: Maxime Ripard
Date: Tue Jun 28 2022 - 04:21:12 EST
Hi,
On Tue, Jun 28, 2022 at 02:36:57PM +0800, Yu Liao wrote:
> The "perfmon" pointer is equal to the return value of idr_find
> which may be NULL, access by vc4_perfmon_get before checking if
> it was NULL. Fix this by dereferencing "perfmon" after "perfmon"
> has been null checked.
>
> Addresses-Coverity: ("Dereference before null check")
> Fixes: 65101d8c9108 ("drm/vc4: Expose performance counters to userspace")
> Signed-off-by: Yu Liao <liaoyu15@xxxxxxxxxx>
A similar patch has already been merged:
https://lore.kernel.org/dri-devel/20220622080243.22119-1-maxime@xxxxxxxxxx/
Thanks!
Maxime
Attachment:
signature.asc
Description: PGP signature