Commit c64988b5 authored by Dan Carpenter's avatar Dan Carpenter Committed by Ben Hutchings

ipx: call ipxitf_put() in ioctl error path

commit ee0d8d84 upstream.

We should call ipxitf_put() if the copy_to_user() fails.
Reported-by: default avatar李强 <liqiang6-s@360.cn>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent a1141b19
...@@ -1168,11 +1168,10 @@ static int ipxitf_ioctl(unsigned int cmd, void __user *arg) ...@@ -1168,11 +1168,10 @@ static int ipxitf_ioctl(unsigned int cmd, void __user *arg)
sipx->sipx_network = ipxif->if_netnum; sipx->sipx_network = ipxif->if_netnum;
memcpy(sipx->sipx_node, ipxif->if_node, memcpy(sipx->sipx_node, ipxif->if_node,
sizeof(sipx->sipx_node)); sizeof(sipx->sipx_node));
rc = -EFAULT; rc = 0;
if (copy_to_user(arg, &ifr, sizeof(ifr))) if (copy_to_user(arg, &ifr, sizeof(ifr)))
break; rc = -EFAULT;
ipxitf_put(ipxif); ipxitf_put(ipxif);
rc = 0;
break; break;
} }
case SIOCAIPXITFCRT: case SIOCAIPXITFCRT:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment