i2c: core: decrease reference count of device node in i2c_unregister_device
authorLixin Wang <alan.1.wang@nokia-sbell.com>
Mon, 27 Nov 2017 07:06:55 +0000 (15:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:50:20 +0000 (07:50 +0200)
commitc0b86d269bf097fd100e275574ae50f1aec248ad
tree7af341421517f8e1438ac164e38c3c34db1867b4
parent2d5fc7ffa84bfa0d778c30b96072295ad36a1030
i2c: core: decrease reference count of device node in i2c_unregister_device

commit e0638fa400eaccf9fa8060f67140264c4e276552 upstream.

Reference count of device node was increased in of_i2c_register_device,
but without decreasing it in i2c_unregister_device. Then the added
device node will never be released. Fix this by adding the of_node_put.

Signed-off-by: Lixin Wang <alan.1.wang@nokia-sbell.com>
Tested-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/i2c-core-base.c