mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-02-24 03:52:22 +07:00
stmmac: platform: Fix signedness bug in stmmac_probe_config_dt()
[ Upstream commit eca81f09145d765c21dd8fb1ba5d874ca255c32c ]
The "plat->phy_interface" variable is an enum and in this context GCC
will treat it as an unsigned int so the error handling is never
triggered.
Fixes: b9f0b2f634
("net: stmmac: platform: fix probe for ACPI devices")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
79ec7b5b2f
commit
bb737eceb9
@ -399,6 +399,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
|
|||||||
struct device_node *np = pdev->dev.of_node;
|
struct device_node *np = pdev->dev.of_node;
|
||||||
struct plat_stmmacenet_data *plat;
|
struct plat_stmmacenet_data *plat;
|
||||||
struct stmmac_dma_cfg *dma_cfg;
|
struct stmmac_dma_cfg *dma_cfg;
|
||||||
|
int phy_mode;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL);
|
plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL);
|
||||||
@ -413,10 +414,11 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
|
|||||||
*mac = NULL;
|
*mac = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
plat->phy_interface = device_get_phy_mode(&pdev->dev);
|
phy_mode = device_get_phy_mode(&pdev->dev);
|
||||||
if (plat->phy_interface < 0)
|
if (phy_mode < 0)
|
||||||
return ERR_PTR(plat->phy_interface);
|
return ERR_PTR(phy_mode);
|
||||||
|
|
||||||
|
plat->phy_interface = phy_mode;
|
||||||
plat->interface = stmmac_of_get_mac_mode(np);
|
plat->interface = stmmac_of_get_mac_mode(np);
|
||||||
if (plat->interface < 0)
|
if (plat->interface < 0)
|
||||||
plat->interface = plat->phy_interface;
|
plat->interface = plat->phy_interface;
|
||||||
|
Loading…
Reference in New Issue
Block a user