power_supply: charger-manager: Fix dereferencing of ERR_PTR
If power_supply_register() fails do not dereference returned ERR_PTR. The pointer was dereferenced to print name of battery which registration failed. Instead use the name from the power supply description passed to the power_supply_register() function. Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Reported-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
Showing
想要评论请 注册 或 登录