Skip to content

Commit

Permalink
ipx: call ipxitf_put() in ioctl error path
Browse files Browse the repository at this point in the history
We should call ipxitf_put() if the copy_to_user() fails

Change-Id: I365777e4a07923a2c96c5523d9046b9c9007f289
Reported-by: 李强 <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Git-commit: ee0d8d8482345ff97a75a7d747efc309f13b0d80
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git
Signed-off-by: Tejaswi Tanikella <[email protected]>
Signed-off-by: Francisco Franco <[email protected]>
  • Loading branch information
Dan Carpenter authored and franciscofranco committed Dec 9, 2017
1 parent 43cbba4 commit 5807483
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/ipx/af_ipx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
rc = 0;
if (copy_to_user(arg, &ifr, sizeof(ifr)))
break;
rc = -EFAULT;
ipxitf_put(ipxif);
rc = 0;
break;
}
case SIOCAIPXITFCRT:
Expand Down

0 comments on commit 5807483

Please sign in to comment.