staging: spmi: hisi-spmi-controller: Fix some error handling paths
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 13 Dec 2020 15:11:05 +0000 (16:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Jan 2021 17:27:25 +0000 (18:27 +0100)
commit560e9b900e12781706b686e7aa40fb59c9fa5dcb
tree8a5d9469ee23c8480f9f6a0393031b51b6cdc115
parentc78cff56baad24ebb10d748e1a1b78bae203debe
staging: spmi: hisi-spmi-controller: Fix some error handling paths

[ Upstream commit 12b38ea040b3bb2a30eb9cd488376df5be7ea81f ]

IN the probe function, if an error occurs after calling
'spmi_controller_alloc()', it must be undone by a corresponding
'spmi_controller_put() call.

In the remove function, use 'spmi_controller_put(ctrl)' instead of
'kfree(ctrl)'.

While a it fix an error message
(s/spmi_add_controller/spmi_controller_add/)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20201213151105.137731-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/hikey9xx/hisi-spmi-controller.c