net: core: check dev_valid_name in __dev_alloc_name
We currently only exclude non-sysfs-friendly names via dev_get_valid_name; there doesn't seem to be a reason to allow such names when we're called via dev_alloc_name. This does duplicate the dev_valid_name check in the dev_get_valid_name() case; we'll fix that shortly. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
6224abda0d
commit
93809105cf
@ -1064,6 +1064,9 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf)
|
|||||||
unsigned long *inuse;
|
unsigned long *inuse;
|
||||||
struct net_device *d;
|
struct net_device *d;
|
||||||
|
|
||||||
|
if (!dev_valid_name(name))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
p = strchr(name, '%');
|
p = strchr(name, '%');
|
||||||
if (p) {
|
if (p) {
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user