]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: most: core: drop device reference
authorChristian Gromm <christian.gromm@microchip.com>
Thu, 23 Jan 2020 15:38:18 +0000 (16:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Jan 2020 09:08:40 +0000 (10:08 +0100)
This patch drops the device reference added by function
bus_find_device_by_name.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Link: https://lore.kernel.org/r/1579793906-5054-3-git-send-email-christian.gromm@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/core.c

index d0fe873ce67ab7e8fe8e9ee1e2932a15ca8adc59..da79076e03d4804409cc05b32eb1309c07a85b5b 100644 (file)
@@ -534,6 +534,7 @@ static struct most_channel *get_channel(char *mdev, char *mdev_ch)
        dev = bus_find_device_by_name(&mc.bus, NULL, mdev);
        if (!dev)
                return NULL;
+       put_device(dev);
        iface = dev_get_drvdata(dev);
        list_for_each_entry_safe(c, tmp, &iface->p->channel_list, list) {
                if (!strcmp(dev_name(&c->dev), mdev_ch))