Skip to content

Commit 913f3c0

Browse files
Yuuoniygregkh
authored andcommitted
most: core: Drop device reference after usage in get_channel()
commit b47b493 upstream. In get_channel(), the reference obtained by bus_find_device_by_name() was dropped via put_device() before accessing the device's driver data Move put_device() after usage to avoid potential issues. Fixes: 2485055 ("staging: most: core: drop device reference") Cc: stable <stable@kernel.org> Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20250804082955.3621026-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f947b1f commit 913f3c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/most/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,8 @@ static struct most_channel *get_channel(char *mdev, char *mdev_ch)
538538
dev = bus_find_device_by_name(&mostbus, NULL, mdev);
539539
if (!dev)
540540
return NULL;
541-
put_device(dev);
542541
iface = dev_get_drvdata(dev);
542+
put_device(dev);
543543
list_for_each_entry_safe(c, tmp, &iface->p->channel_list, list) {
544544
if (!strcmp(dev_name(&c->dev), mdev_ch))
545545
return c;

0 commit comments

Comments
 (0)