提交 ee0d8d84 编写于 作者: D Dan Carpenter 提交者: David S. Miller

ipx: call ipxitf_put() in ioctl error path

We should call ipxitf_put() if the copy_to_user() fails.
Reported-by: N李强 <liqiang6-s@360.cn>
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9da3242e
......@@ -1168,11 +1168,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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册