]> git.baikalelectronics.ru Git - kernel.git/commit
net: core: drop pointless check in __dev_alloc_name
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Sun, 12 Nov 2017 23:15:07 +0000 (00:15 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Nov 2017 07:38:46 +0000 (16:38 +0900)
commit61296f45431113aa8ff598c11c36a072be90e71f
treeaa6b654bc0e22efdf73a65db0d90b411d45a87e5
parente9e3e7df069f5924d4783e5a4d8c55cad4f14e90
net: core: drop pointless check in __dev_alloc_name

The only caller passes a stack buffer as buf, so it won't equal the
passed-in name. Moreover, we're already using buf as a scratch buffer
inside the if (p) {} block, so if buf and name were the same, that
snprintf() call would be overwriting its own format string.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c