tuntap: fix error return code in tun_set_iff()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 12 Apr 2013 03:17:12 +0000 (03:17 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Apr 2013 19:00:04 +0000 (15:00 -0400)
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

[ Bug added in linux-3.8 , commit 4008e97f866db665
  ("tuntap: fix ambigious multiqueue API") ]

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c

index b7c457adc0dc7439cc2a842409ed3871207f079b..729ed533bb33834fac05825be4b344a755e0e859 100644 (file)
@@ -1594,7 +1594,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
 
                if (tun->flags & TUN_TAP_MQ &&
                    (tun->numqueues + tun->numdisabled > 1))
-                       return err;
+                       return -EBUSY;
        }
        else {
                char *name;