diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index 8c06a5065772..a26ed1ea058a 100644 --- a/net/ipx/af_ipx.c +++ b/net/ipx/af_ipx.c @@ -1194,11 +1194,10 @@ static int ipxitf_ioctl(unsigned int cmd, void __user *arg) sipx->sipx_network = ipxif->if_netnum; memcpy(sipx->sipx_node, ipxif->if_node, sizeof(sipx->sipx_node)); - rc = -EFAULT; - if (copy_to_user(arg, &ifr, sizeof(ifr))) - break; - ipxitf_put(ipxif); rc = 0; + if (copy_to_user(arg, &ifr, sizeof(ifr))) + rc = -EFAULT; + ipxitf_put(ipxif); break; } case SIOCAIPXITFCRT: