summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2017-11-13 00:15:09 +0100
committerDavid S. Miller <davem@davemloft.net>2017-11-14 16:38:46 +0900
commitd6f295e9def0bee85b37bdffb95153721935c342 (patch)
tree91b9731a114dd729bad294f9243e05de41e917b6 /net/core
parent93809105cf9d43790839d8b8e29a8a505290ec68 (diff)
downloadblackbird-op-linux-d6f295e9def0bee85b37bdffb95153721935c342.tar.gz
blackbird-op-linux-d6f295e9def0bee85b37bdffb95153721935c342.zip
net: core: maybe return -EEXIST in __dev_alloc_name
If we're given format string with no %d, -EEXIST is a saner error code. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index cb3d95edf58d..1bb856eaed1c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1106,7 +1106,7 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf)
* when the name is long and there isn't enough space left
* for the digits, or if all bits are used.
*/
- return -ENFILE;
+ return p ? -ENFILE : -EEXIST;
}
static int dev_alloc_name_ns(struct net *net,
OpenPOWER on IntegriCloud