linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] most: core: fix resource leak in most_register_interface error paths
@ 2025-11-25 22:56 Navaneeth K
  2025-11-25 22:56 ` [PATCH v2 1/2] " Navaneeth K
  2025-11-25 22:56 ` [PATCH v2 2/2] most: usb: remove double cleanup of interface on registration failure Navaneeth K
  0 siblings, 2 replies; 7+ messages in thread
From: Navaneeth K @ 2025-11-25 22:56 UTC (permalink / raw)
  To: parthiban.veerasooran, christian.gromm, gregkh
  Cc: linux-staging, linux-kernel, Navaneeth K

This series fixes a resource leak in most_register_interface() where
early errors (allocation failures) would return without releasing the
device, leaking memory.

It switches to the split device_initialize() + device_add() pattern
to ensure put_device() can be safely called on all error paths.

It also updates the most_usb driver to remove manual error handling
that would otherwise cause a double-free with the new core logic.

Changes in v2:
  - Replaced the previous single-driver fix ("staging: most: dim2: fix
    missing cleanup...") which was NACKed because it introduced a
    double-free risk.
  - Moved the fix to the Core (core.c) to handle cleanup centrally via
    put_device().
  - Updated most_usb.c to remove conflicting manual cleanup.
  - Dropped the dim2.c patch as the upstream code is already correct for
    this new core logic (it relies on the release callback, which core
    now triggers).

Navaneeth K (2):
  most: core: fix resource leak in most_register_interface error paths
  most: usb: remove double cleanup of interface on registration failure

 drivers/most/core.c     |  9 +++++++--
 drivers/most/most_usb.c | 11 +++--------
 2 files changed, 10 insertions(+), 10 deletions(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-11-26 22:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-25 22:56 [PATCH v2 0/2] most: core: fix resource leak in most_register_interface error paths Navaneeth K
2025-11-25 22:56 ` [PATCH v2 1/2] " Navaneeth K
2025-11-25 23:10   ` Navaneeth K
2025-11-26 17:23   ` Abdun Nihaal
2025-11-25 22:56 ` [PATCH v2 2/2] most: usb: remove double cleanup of interface on registration failure Navaneeth K
2025-11-26 17:31   ` Abdun Nihaal
2025-11-26 22:08     ` Navaneeth K

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).