]> git.baikalelectronics.ru Git - kernel.git/commit
tun: allow positive return values on dev_get_valid_name() call
authorJulien Gomes <julien@arista.com>
Wed, 25 Oct 2017 18:50:50 +0000 (11:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Oct 2017 01:10:03 +0000 (10:10 +0900)
commit98a3bc8302fe1c153549a667eb2ed0a370d32c35
tree1d8fdcdcfd73a05f73cd37ec1a32ca2e11a23595
parentc5c1971550caabb37846c072b8b833a13d53e03d
tun: allow positive return values on dev_get_valid_name() call

If the name argument of dev_get_valid_name() contains "%d", it will try
to assign it a unit number in __dev__alloc_name() and return either the
unit number (>= 0) or an error code (< 0).
Considering positive values as error values prevent tun device creations
relying this mechanism, therefor we should only consider negative values
as errors here.

Signed-off-by: Julien Gomes <julien@arista.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c