]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
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)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 7 Dec 2021 06:33:23 +0000 (07:33 +0100)
commitc08728c4c8feda8924631132a943f1133314dad5
treec4887670d95f3be9e5d61bf17aed4fba19a5b318
parent5a58d21f7eac9dbca9ab95c330857a5ba25367fe
phy: ti: gmii-sel: check of_get_address() for failure

BugLink: https://bugs.launchpad.net/bugs/1951822
[ 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>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/phy/ti/phy-gmii-sel.c