media: Revert 2a934fdb01db ("media: v4l2-dev: fix error handling in __video_register_device()")
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | Revert "media: v4l2-dev: fix error handling in __video_register_device()"drivers/ | +7 | 0 replies | |
| 2/2 | media: v4l2-core: v4l2-dev: add comments on device_register fail.drivers/ | +14 | 0 replies |
Reviews trailers per patch
None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Laurent Pinchart |
|---|---|
| Series | R-b |
| 1/2 | |
| 2/2 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] media: Revert 2a934fdb01db ("media: v4l2-dev: fix error handling in __video_register_device()")
That commit exchanged a memory leak with a double-free scenario, and it is not something that is easily fixable. Revert it, since it is still better to leak memory than get into a double-free.
See this email discussion for more info:
https://lore.kernel.org/linux-media/[email protected]/
I tried to come up with a reliable method to handle this cleanly in the v4l2 core, but the only way to do this properly would be to split video_register_device into two parts: an init and a registration part. And then convert all drivers to use the new functions.
That's a very big job, and so for now just revert the patch and add comments explaining why it is reverted.
Regards,
Hans
Hans Verkuil (2):
Revert "media: v4l2-dev: fix error handling in
__video_register_device()"
media: v4l2-core: v4l2-dev: add comments on device_register fail.
drivers/media/v4l2-core/v4l2-dev.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-)
Signature · 1 line
2.53.0