diff options
| author | Brad Spengler <brad.spengler@opensrcsec.com> | 2026-01-07 12:12:36 -0500 |
|---|---|---|
| committer | Zack Rusin <zack.rusin@broadcom.com> | 2026-02-05 12:43:51 -0500 |
| commit | 211ecfaaef186ee5230a77d054cdec7fbfc6724a (patch) | |
| tree | d3f633c4a0506730cdf60306003b2fea12257b09 /tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git | |
| parent | 40b24d9cdd4141ef43eeaa7e57c3efc07a567473 (diff) | |
drm/vmwgfx: Fix invalid kref_put callback in vmw_bo_dirty_release
The kref_put() call uses (void *)kvfree as the release callback, which
is incorrect. kref_put() expects a function with signature
void (*release)(struct kref *), but kvfree has signature
void (*)(const void *). Calling through an incompatible function pointer
is undefined behavior.
The code only worked by accident because ref_count is the first member
of vmw_bo_dirty, making the kref pointer equal to the struct pointer.
Fix this by adding a proper release callback that uses container_of()
to retrieve the containing structure before freeing.
Fixes: c1962742ffff ("drm/vmwgfx: Use kref in vmw_bo_dirty")
Signed-off-by: Brad Spengler <brad.spengler@opensrcsec.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Cc: Ian Forbes <ian.forbes@broadcom.com>
Link: https://patch.msgid.link/20260107171236.3573118-1-zack.rusin@broadcom.com
Diffstat (limited to 'tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
