diff options
| author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-05-02 13:58:53 +0300 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2017-06-20 16:12:04 +0200 |
| commit | cbbab14b5fee282d842ae465e3835dfa847efe36 (patch) | |
| tree | 22ccbec5874720c997b988217c4621f5ffdf8182 /net | |
| parent | 16e45e9b79ed6d9250a5924b7e515d6bb6026a3f (diff) | |
UPSTREAM: ipx: call ipxitf_put() in ioctl error path
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>
(Cherry-pick from commit ee0d8d8482345ff97a75a7d747efc309f13b0d80)
Bug: 62070688
Diffstat (limited to 'net')
| -rw-r--r-- | net/ipx/af_ipx.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index 2665bf4b8..f86f096aa 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: |
