diff options
| author | Ma Ke <[email protected]> | 2025-07-19 07:58:56 +0000 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2025-07-22 16:02:17 +0000 |
| commit | 63ce53724637e2e7ba51fe3a4f78351715049905 (patch) | |
| tree | 65ad54e46b30d6120a9d562b2329d7cc67dc0bc9 /lib/crypto/mpi/mpi-add.c | |
| parent | Merge tag 'md-6.17-20250722' of https://git.kernel.org/pub/scm/linux/kernel/g... (diff) | |
| download | kernel-63ce53724637e2e7ba51fe3a4f78351715049905.tar.gz kernel-63ce53724637e2e7ba51fe3a4f78351715049905.zip | |
sunvdc: Balance device refcount in vdc_port_mpgroup_check
Using device_find_child() to locate a probed virtual-device-port node
causes a device refcount imbalance, as device_find_child() internally
calls get_device() to increment the device’s reference count before
returning its pointer. vdc_port_mpgroup_check() directly returns true
upon finding a matching device without releasing the reference via
put_device(). We should call put_device() to decrement refcount.
As comment of device_find_child() says, 'NOTE: you will need to drop
the reference with put_device() after use'.
Found by code review.
Cc: [email protected]
Fixes: 3ee70591d6c4 ("sunvdc: prevent sunvdc panic when mpgroup disk added to guest domain")
Signed-off-by: Ma Ke <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'lib/crypto/mpi/mpi-add.c')
0 files changed, 0 insertions, 0 deletions
