phy: ti: gmii-sel: check of_get_address() for failure
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 14 Sep 2021 11:00:38 +0000 (14:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 13:04:20 +0000 (14:04 +0100)
commitfd056574a7e8322c847b458cfe7c1343dcc32497
tree233fc5404d6522d885e7b6008895e63b487ee04d
parent0a46740a0af08e3ee1a572bf4073a564c9cb160a
phy: ti: gmii-sel: check of_get_address() for failure

[ Upstream commit 8d55027f4e2c04146a75fb63371ab96ccc887f2c ]

Smatch complains that if of_get_address() returns NULL, then "size"
isn't initialized.  Also it would lead to an Oops.

Fixes: 7f78322cdd67 ("phy: ti: gmii-sel: retrieve ports number and base offset from dt")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Link: https://lore.kernel.org/r/20210914110038.GB11657@kili
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/phy/ti/phy-gmii-sel.c