1
0
Fork 0

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>
utp
Helmut Raiger 2011-08-22 00:17:17 +00:00 committed by Wolfgang Denk
parent 24e1664472
commit 7e7f903fcd
1 changed files with 2 additions and 0 deletions

View File

@ -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;