power: supply: fix null pointer check order in __power_supply_register

There is an null pointer check order issue here: if we have to
check !desc and !desc->name anyway, check it before dereferencing it in
pr_warn().

Signed-off-by: qinyu <qinyu32@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
qinyu 2023-02-23 16:10:47 +08:00 • committed by Sebastian Reichel
commit bfaecf465a