From: Jason Wang Date: Mon, 22 Apr 2013 20:40:39 +0000 (+0000) Subject: tuntap: correct the return value in tun_set_iff() X-Git-Tag: upstream/snapshot3+hdmi~5230^2~15^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e8dbad66ef56074eadb41ed5998acd2320447018;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git tuntap: correct the return value in tun_set_iff() commit (3be8fbab tuntap: fix error return code in tun_set_iff()) breaks the creation of multiqueue tuntap since it forbids to create more than one queues for a multiqueue tuntap device. We need return 0 instead -EBUSY here since we don't want to re-initialize the device when one or more queues has been already attached. Add a comment and correct the return value to zero. Reported-by: Jerry Chu Cc: Jerry Chu Cc: Wei Yongjun Cc: Eric Dumazet Signed-off-by: Jason Wang Acked-by: Jerry Chu Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller --- diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 729ed53..0c9df2f 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -1593,8 +1593,12 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) return err; if (tun->flags & TUN_TAP_MQ && - (tun->numqueues + tun->numdisabled > 1)) - return -EBUSY; + (tun->numqueues + tun->numdisabled > 1)) { + /* One or more queue has already been attached, no need + * to initialize the device again. + */ + return 0; + } } else { char *name;