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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1476747349-10737-1-git-send-email-weiyj.lk@gmail.com>
Date:   Mon, 17 Oct 2016 23:35:49 +0000
From:   Wei Yongjun <weiyj.lk@...il.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Sergio Paracuellos <sergio.paracuellos@...il.com>,
        Dilek Uzulmez <dilekuzulmez@...il.com>,
        Jonas Rickert <jrickertkc@...il.com>,
        Wayne Porter <wporter82@...il.com>,
        Amitoj Kaur Chawla <amitoj1606@...il.com>,
        Sandhya Bankar <bankarsandhya512@...il.com>,
        MingChia Chung <quexint@...il.com>
Cc:     Wei Yongjun <weiyongjun1@...wei.com>, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH -next] staging: rts5208: rtsx.c: Fix invalid use of sizeof in rtsx_probe()

From: Wei Yongjun <weiyongjun1@...wei.com>

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

Fixes: 2eb9d8cbb3c3 ("staging: rts5208: rtsx.c: Alloc sizeof struct")
Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
---
 drivers/staging/rts5208/rtsx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
index f3e5efd..68d75d0 100644
--- a/drivers/staging/rts5208/rtsx.c
+++ b/drivers/staging/rts5208/rtsx.c
@@ -884,7 +884,7 @@ static int rtsx_probe(struct pci_dev *pci,
 	dev = host_to_rtsx(host);
 	memset(dev, 0, sizeof(struct rtsx_dev));
 
-	dev->chip = kzalloc(sizeof(dev->chip), GFP_KERNEL);
+	dev->chip = kzalloc(sizeof(*dev->chip), GFP_KERNEL);
 	if (!dev->chip) {
 		err = -ENOMEM;
 		goto errout;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ