Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

slimbus: core: fix device reference leak on report present

Slimbus devices can be allocated dynamically upon reception of
report-present messages.

Make sure to drop the reference taken when looking up already registered
devices.

Note that this requires taking an extra reference in case the device has
not yet been registered and has to be allocated.

Fixes: 46a2bb5a7f7e ("slimbus: core: Add slim controllers support")
Cc: stable@vger.kernel.org # 4.16
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20251126145329.5022-4-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
9391380e 0eb4ff65

+3
+3
drivers/slimbus/core.c
··· 379 379 sbdev = slim_alloc_device(ctrl, e_addr, NULL); 380 380 if (!sbdev) 381 381 return ERR_PTR(-ENOMEM); 382 + 383 + get_device(&sbdev->dev); 382 384 } 383 385 384 386 return sbdev; ··· 507 505 ret = slim_device_alloc_laddr(sbdev, true); 508 506 } 509 507 508 + put_device(&sbdev->dev); 510 509 out_put_rpm: 511 510 pm_runtime_mark_last_busy(ctrl->dev); 512 511 pm_runtime_put_autosuspend(ctrl->dev);