tun: correctly report an error in tun_flow_init()
Subsystems (3)
PATCH 1/1 tun: correctly report an error in tun_flow_init()
On error, the error code from tun_flow_init() is lost inside tun_set_iff(), this patch fixes this by assigning the tun_flow_init() error code to the "err" variable which is returned by
the tun_flow_init() function on error.
--- drivers/net/tun.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/tun.c +2 -1
@@ -1591,7 +1591,8 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)tun_net_init (dev); -if (tun_flow_init (tun)) + err =tun_flow_init (tun); +if (err <0 ) goto err_free_dev; dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST |
Quoted 6 lines · Paul Moore
On error, the error code from
tun_flow_init()is lost insidetun_set_iff(), this patch fixes this by assigning thetun_flow_init()error code to the "err" variable which is returned by
thetun_flow_init()function on error.Signed-off-by Paul Moore <[email protected]>
Thanks Paul.
Quoted 24 lines
--- drivers/net/tun.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/tun.c +2
-1@@ -1591,7 +1591,8 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)tun_net_init (dev); -if (tun_flow_init (tun)) + err =tun_flow_init (tun); +if (err <0 ) goto err_free_dev;
dev->hw_features=NETIF_F_SG|NETIF_F_FRAGLIST|--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Jason Wang <[email protected]>
Date: Fri, 07 Dec 2012 13:51:47 +0800
Quoted 9 lines · Paul Moore
Quoted 6 lines
On error, the error code from
tun_flow_init()is lost insidetun_set_iff(), this patch fixes this by assigning thetun_flow_init()error code to the "err" variable which is returned by
thetun_flow_init()function on error.Signed-off-by Paul Moore <[email protected]>Acked-by Jason Wang <[email protected]>
Applied, thanks.