summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-01-07 16:44:22 -0700
committerSimon Glass <sjg@chromium.org>2019-01-14 17:47:13 -0700
commit8405452e6abab07cf445ba307b3ca58d39a097ba (patch)
treeff2053b20ff874c686e46b7175d1d1749b09da25
parente9500f49ea350b14973bdacd9948f9c2177ff2a8 (diff)
net: Fix error handling in sb_eth_raw_ofdata_to_platdata()
At present this stores the error number in an unsigned int so an error is never detected. Use the existing signed variable instead. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
-rw-r--r--drivers/net/sandbox-raw.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/sandbox-raw.c b/drivers/net/sandbox-raw.c
index 09cc678ebd..7e6625d020 100644
--- a/drivers/net/sandbox-raw.c
+++ b/drivers/net/sandbox-raw.c
@@ -152,7 +152,6 @@ static int sb_eth_raw_ofdata_to_platdata(struct udevice *dev)
struct eth_pdata *pdata = dev_get_platdata(dev);
struct eth_sandbox_raw_priv *priv = dev_get_priv(dev);
const char *ifname;
- u32 local;
int ret;
pdata->iobase = dev_read_addr(dev);
@@ -173,10 +172,10 @@ static int sb_eth_raw_ofdata_to_platdata(struct udevice *dev)
priv->host_ifindex, priv->host_ifname);
}
- local = sandbox_eth_raw_os_is_local(priv->host_ifname);
- if (local < 0)
- return local;
- priv->local = local;
+ ret = sandbox_eth_raw_os_is_local(priv->host_ifname);
+ if (ret < 0)
+ return ret;
+ priv->local = ret;
return 0;
}