lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPgLHd-4=Nie0-jdy9-0V9v5GfgKP5L3XycQdw1qWL3dhzYjMw@mail.gmail.com>
Date:	Fri, 22 Mar 2013 21:22:07 +0800
From:	Wei Yongjun <weiyj.lk@...il.com>
To:	s-anna@...com, linus.walleij@...aro.org, loic.pallardy@...com,
	omar.ramirez@...itl.com, lugo.fernando@...il.com
Cc:	yongjun_wei@...ndmicro.com.cn, linux-kernel@...r.kernel.org
Subject: [PATCH -next] mailbox: fix invalid use of sizeof in mailbox_msg_send()

From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>

sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
---
 drivers/mailbox/mailbox.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index 5fea5c2..e011a75 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -93,8 +93,8 @@ int mailbox_msg_send(struct mailbox *mbox, struct mailbox_msg *msg)
 		goto out;
 	}
 
-	len = kfifo_in(&mq->fifo, (unsigned char *)msg, sizeof(msg));
-	WARN_ON(len != sizeof(msg));
+	len = kfifo_in(&mq->fifo, (unsigned char *)msg, sizeof(*msg));
+	WARN_ON(len != sizeof(*msg));
 
 	if (msg->size && msg->pdata) {
 		len = kfifo_in(&mq->fifo, (unsigned char *)msg->pdata,


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ