mirror of
https://github.com/torvalds/linux.git
synced 2026-12-02 03:22:37 +00:00
Change devm_k*alloc to k*alloc to manually allocate memory The manual allocation and freeing of memory is necessary because when the USB radio is disconnected, the memory associated with devm_k*alloc is freed. Meaning if we still have unresolved references to the radio device, then we get use-after-free errors. This patch fixes this by manually allocating memory, and freeing it in the v4l2.release callback that gets called when the last radio device exits. Reported-and-tested-by: [email protected] Signed-off-by: Luke Nowakowski-Krijger <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [[email protected]: cleaned up two small checkpatch.pl warnings] [[email protected]: prefix subject with driver name] Signed-off-by: Mauro Carvalho Chehab <[email protected]>