summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Raiger <helmut.raiger@hale.at>2011-08-22 00:17:17 +0000
committerWolfgang Denk <wd@denx.de>2011-09-09 23:58:47 +0200
commit7e7f903fcd7883d3646223e3cb30b50a7dfe6248 (patch)
treec8c1b3aa1dfec9534d1b9f90aa858fdd54222ba5
parent24e1664472deef23abb3246da8573ddefc0c7971 (diff)
downloadu-boot-imx-7e7f903fcd7883d3646223e3cb30b50a7dfe6248.zip
u-boot-imx-7e7f903fcd7883d3646223e3cb30b50a7dfe6248.tar.gz
u-boot-imx-7e7f903fcd7883d3646223e3cb30b50a7dfe6248.tar.bz2
net/eth.c: throw BUG for eth_get_dev_by_name(NULL)
eth_get_dev_by_name() is not safe to use for devname being NULL as it uses strcmp. This patch makes it fail with a BUG(). Signed-off-by: Helmut Raiger <helmut.raiger@hale.at> Acked-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--net/eth.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/eth.c b/net/eth.c
index dbd1e2d..5911b1c 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -108,6 +108,8 @@ struct eth_device *eth_get_dev_by_name(const char *devname)
{
struct eth_device *dev, *target_dev;
+ BUG_ON(devname == NULL);
+
if (!eth_devices)
return NULL;