net: remove dev_valid_name() check from __dev_alloc_name()

__dev_alloc_name() is only called by dev_prep_valid_name(),
which already checks that name is valid.

Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20231023152346.3639749-6-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski 2023-10-23 08:23:45 -07:00
parent 7ad17b04dc
commit 70e1b14c1b

View File

@ -1077,9 +1077,6 @@ static int __dev_alloc_name(struct net *net, const char *name, char *res)
struct net_device *d;
char buf[IFNAMSIZ];
if (!dev_valid_name(name))
return -EINVAL;
/* Verify the string as this thing may have come from the user.
* There must be one "%d" and no other "%" characters.
*/