diff options
| author | Xiyu Yang <[email protected]> | 2020-04-20 05:44:16 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2020-04-23 11:45:24 +0000 |
| commit | 332e0e17ad49e084b7db670ef43b5eb59abd9e34 (patch) | |
| tree | 11a7692ca70aacb3d03d1023776630546063c2a4 /tools/perf/scripts/python/mem-phys-addr.py | |
| parent | staging: vt6656: Fix pairwise key entry save. (diff) | |
| download | kernel-332e0e17ad49e084b7db670ef43b5eb59abd9e34.tar.gz kernel-332e0e17ad49e084b7db670ef43b5eb59abd9e34.zip | |
staging: comedi: Fix comedi_device refcnt leak in comedi_open
comedi_open() invokes comedi_dev_get_from_minor(), which returns a
reference of the COMEDI device to "dev" with increased refcount.
When comedi_open() returns, "dev" becomes invalid, so the refcount
should be decreased to keep refcount balanced.
The reference counting issue happens in one exception handling path of
comedi_open(). When "cfp" allocation is failed, the refcnt increased by
comedi_dev_get_from_minor() is not decreased, causing a refcnt leak.
Fix this issue by calling comedi_dev_put() on this error path when "cfp"
allocation is failed.
Fixes: 20f083c07565 ("staging: comedi: prepare support for per-file read and write subdevices")
Signed-off-by: Xiyu Yang <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Xin Tan <[email protected]>
Signed-off-by: Ian Abbott <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/mem-phys-addr.py')
0 files changed, 0 insertions, 0 deletions
