Skip to content

Commit 8a5b15e

Browse files
Dan Carpentergregkh
authored andcommitted
ipx: call ipxitf_put() in ioctl error path
commit ee0d8d8482345ff97a75a7d747efc309f13b0d80 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4ae1efc commit 8a5b15e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

net/ipx/af_ipx.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,11 +1168,10 @@ static int ipxitf_ioctl(unsigned int cmd, void __user *arg)
11681168
sipx->sipx_network = ipxif->if_netnum;
11691169
memcpy(sipx->sipx_node, ipxif->if_node,
11701170
sizeof(sipx->sipx_node));
1171-
rc = -EFAULT;
1171+
rc = 0;
11721172
if (copy_to_user(arg, &ifr, sizeof(ifr)))
1173-
break;
1173+
rc = -EFAULT;
11741174
ipxitf_put(ipxif);
1175-
rc = 0;
11761175
break;
11771176
}
11781177
case SIOCAIPXITFCRT:

0 commit comments

Comments
 (0)