summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-05-02 13:58:53 +0300
committerMark Salyzyn <salyzyn@google.com>2017-07-10 15:50:15 -0700
commit09481cd30a7d9e245c7206233efd4832c032d1c4 (patch)
tree63815a8111f45120ff1f96a0098bb507af13ee2d
parent50ee82cb713d85226a1fd3e546abdffe4c3bbad3 (diff)
downloadtegra-09481cd30a7d9e245c7206233efd4832c032d1c4.tar.gz
UPSTREAM: ipx: call ipxitf_put() in ioctl error path
(Cherry-pick from commit ee0d8d8482345ff97a75a7d747efc309f13b0d80) We should call ipxitf_put() if the copy_to_user() fails. Reported-by: 李强 <liqiang6-s@360.cn> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net> Bug: 62070688 Change-Id: I40f3f6bd75014bd572e51a9142949042c004bd91
-rw-r--r--net/ipx/af_ipx.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
index 2665bf4b8d05..f86f096aa16a 100644
--- a/net/ipx/af_ipx.c
+++ b/net/ipx/af_ipx.c
@@ -1183,11 +1183,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;
+ rc = 0;
if (copy_to_user(arg, &ifr, sizeof(ifr)))
- break;
+ rc = -EFAULT;
ipxitf_put(ipxif);
- rc = 0;
break;
}
case SIOCAIPXITFCRT: