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 18:16:55 +0000 (19:16 +0100)
commit69cd3bdff881de4f5b853433f99142c5b7163978
tree9b1fc2714f1c9f4a2705e5b679cfeb06e143d57f
parentca1e04c638508334b5f37668c4155567974ce2f6
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