]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: cx231xx: fix devres lifetime
authorJohan Hovold <johan@kernel.org>
Mon, 30 Mar 2026 09:37:27 +0000 (11:37 +0200)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 6 May 2026 07:05:56 +0000 (09:05 +0200)
commit7d6358ab02866e5b7ed8d3a00805297617bbb0ec
treeb7c7a217f8a658dcce4775774eed054d52012e2d
parenta0701e387b46e2481c05b47f1235b954bfc2af3e
media: cx231xx: fix devres lifetime

USB drivers bind to USB interfaces and any device managed resources
should have their lifetime tied to the interface rather than parent USB
device. This avoids issues like memory leaks when drivers are unbound
without their devices being physically disconnected (e.g. on probe
deferral or configuration changes).

Fix the driver state lifetime so that it is released on driver unbind.

Fixes: 184a82784d50 ("[media] cx231xx: use devm_ functions to allocate memory")
Cc: stable@vger.kernel.org # 3.17
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/usb/cx231xx/cx231xx-cards.c