media: vsp1: vsp1_dl: Detect double list release
authorJacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
Mon, 16 Jun 2025 16:30:37 +0000 (18:30 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Wed, 18 Jun 2025 07:20:46 +0000 (09:20 +0200)
commit30e77ed16bdc79f55b06192a1f5445bd0515fb54
tree86335ea011dac7cc0a556a415d5429dda5c05e64
parent9b7e558c5c72b67ae884709088026efc6b3b5b4a
media: vsp1: vsp1_dl: Detect double list release

In order to detect invalid usage pattern such as double list_put()
calls, add an 'allocated' flag to each display list. Set the flag
whenever a list is get() and clear it when the list is put(). Warn if a
list not marked as allocated is returned to the pool of available
display lists.

Signed-off-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250616-vsp1_dl_list_count-v2-1-7d3f43fb1306@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/renesas/vsp1/vsp1_dl.c