OSDN Git Service

mux: core: fix double get_device()
authorHans de Goede <hdegoede@redhat.com>
Thu, 28 Dec 2017 23:22:54 +0000 (00:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Jan 2018 08:45:27 +0000 (09:45 +0100)
commit45a061d6b4e0e671cc3aa1bed8bf47078eade69e
tree8a14d32a81642dfd9214c4bf7b0c4d9bb720129e
parent8e13548c7f50cba68a0a122218431bec741938f9
mux: core: fix double get_device()

commit aa1f10e85b0ab53dee85d8e293c8159d18d293a8 upstream.

class_find_device already does a get_device on the returned device.
So the device returned by of_find_mux_chip_by_node is already referenced
and we should not reference it again (and unref it on error).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mux/core.c