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>
Please register or sign in to comment