[PATCH] RxRPC: Fix rxrpc_recvmsg()'s returning of msg_name

From: David Howells
Date: Mon Mar 03 2008 - 07:58:18 EST


Fix rxrpc_recvmsg() to return msg_name correctly. We shouldn't overwrite the
*msg struct, but should rather write into msg->msg_name (there's a '&' unary
operator that shouldn't be there).

Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
---

net/rxrpc/ar-recvmsg.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/net/rxrpc/ar-recvmsg.c b/net/rxrpc/ar-recvmsg.c
index f19121d..a39bf97 100644
--- a/net/rxrpc/ar-recvmsg.c
+++ b/net/rxrpc/ar-recvmsg.c
@@ -143,7 +143,8 @@ int rxrpc_recvmsg(struct kiocb *iocb, struct socket *sock,
/* copy the peer address and timestamp */
if (!continue_call) {
if (msg->msg_name && msg->msg_namelen > 0)
- memcpy(&msg->msg_name, &call->conn->trans->peer->srx,
+ memcpy(msg->msg_name,
+ &call->conn->trans->peer->srx,
sizeof(call->conn->trans->peer->srx));
sock_recv_timestamp(msg, &rx->sk, skb);
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/