diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c index 54031ee079a2..45fbf5f4dcd2 100644 --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c @@ -1035,6 +1035,11 @@ static int qrtr_recvmsg(struct socket *sock, struct msghdr *msg, rc = copied; if (addr) { + /* There is an anonymous 2-byte hole after sq_family, + * make sure to clear it. + */ + memset(addr, 0, sizeof(*addr)); + addr->sq_family = AF_QIPCRTR; addr->sq_node = cb->src_node; addr->sq_port = cb->src_port;