]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mfd: core: Fix device reference leak in mfd_clone_cell
authorJohan Hovold <johan@kernel.org>
Tue, 1 Nov 2016 10:38:18 +0000 (11:38 +0100)
committerJiri Slaby <jslaby@suse.cz>
Thu, 24 Nov 2016 15:23:55 +0000 (16:23 +0100)
commit 722f191080de641f023feaa7d5648caf377844f5 upstream.

Make sure to drop the reference taken by bus_find_device_by_name()
before returning from mfd_clone_cell().

Fixes: a9bbba996302 ("mfd: add platform_device sharing support for mfd")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/mfd/mfd-core.c

index f421586f29fb09b02644ee8b05aa6777fb353835..a1f0f73245c55c6c4570298f87eed048b970320a 100644 (file)
@@ -265,6 +265,8 @@ int mfd_clone_cell(const char *cell, const char **clones, size_t n_clones)
                                        clones[i]);
        }
 
+       put_device(dev);
+
        return 0;
 }
 EXPORT_SYMBOL(mfd_clone_cell);