Skip to content

Commit

Permalink
net: core: maybe return -EEXIST in __dev_alloc_name
Browse files Browse the repository at this point in the history
If we're given format string with no %d, -EEXIST is a saner error code.

Signed-off-by: Rasmus Villemoes <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Villemoes authored and davem330 committed Nov 14, 2017
1 parent 9380910 commit d6f295e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d6f295e

Please sign in to comment.