Commit 7e7f903fcd7883d3646223e3cb30b50a7dfe6248

Authored by Helmut Raiger
Committed by Wolfgang Denk
1 parent 24e1664472

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>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

... ... @@ -108,6 +108,8 @@
108 108 {
109 109 struct eth_device *dev, *target_dev;
110 110  
  111 + BUG_ON(devname == NULL);
  112 +
111 113 if (!eth_devices)
112 114 return NULL;
113 115