diff options
| author | Greg Kroah-Hartman <[email protected]> | 2023-05-16 19:20:14 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2023-05-19 10:03:36 +0000 |
| commit | ddaf098ea779b3c1302c7843f6ff01e89b1fd380 (patch) | |
| tree | 50bab0c29d67b5924ac954ca82832fef67c51ba6 /drivers/fpga/zynq-fpga.c | |
| parent | Merge tag 'thunderbolt-for-v6.4-rc3' of git://git.kernel.org/pub/scm/linux/ke... (diff) | |
| download | kernel-ddaf098ea779b3c1302c7843f6ff01e89b1fd380.tar.gz kernel-ddaf098ea779b3c1302c7843f6ff01e89b1fd380.zip | |
driver core: class: properly reference count class_dev_iter()
When class_dev_iter is initialized, the reference count for the subsys
private structure is incremented, but never decremented, causing a
memory leak over time. To resolve this, save off a pointer to the
internal structure into the class_dev_iter structure and then when the
iterator is finished, drop the reference count.
Reported-and-tested-by: [email protected]
Fixes: 7b884b7f24b4 ("driver core: class.c: convert to only use class_to_subsys")
Reported-by: Mirsad Goran Todorovac <[email protected]>
Cc: Alan Stern <[email protected]>
Acked-by: Rafael J. Wysocki <[email protected]>
Tested-by: Mirsad Goran Todorovac <[email protected]>
Link: https://lore.kernel.org/r/2023051610-stove-condense-9a77@gregkh
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/fpga/zynq-fpga.c')
0 files changed, 0 insertions, 0 deletions
