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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190411220056.19109-2-martin.blumenstingl@googlemail.com>
Date:   Fri, 12 Apr 2019 00:00:53 +0200
From:   Martin Blumenstingl <martin.blumenstingl@...glemail.com>
To:     liang.yang@...ogic.com, linux-amlogic@...ts.infradead.org,
        linux-mtd@...ts.infradead.org, richard@....at,
        miquel.raynal@...tlin.com
Cc:     linux-arm-kernel@...ts.infradead.org, marek.vasut@...il.com,
        linux-kernel@...r.kernel.org, computersforpeace@...il.com,
        dwmw2@...radead.org, bbrezillon@...nel.org,
        jianxin.pan@...ogic.com,
        Martin Blumenstingl <martin.blumenstingl@...glemail.com>
Subject: [PATCH 1/4] mtd: rawnand: meson: use struct_size macro

Use the recently introduced struct_size macro instead of open-coding
it's logic.
No functional changes.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
---
 drivers/mtd/nand/raw/meson_nand.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c
index cb0b03e36a35..c1a6af57dab5 100644
--- a/drivers/mtd/nand/raw/meson_nand.c
+++ b/drivers/mtd/nand/raw/meson_nand.c
@@ -1242,8 +1242,7 @@ meson_nfc_nand_chip_init(struct device *dev,
 		return -EINVAL;
 	}
 
-	meson_chip = devm_kzalloc(dev,
-				  sizeof(*meson_chip) + (nsels * sizeof(u8)),
+	meson_chip = devm_kzalloc(dev, struct_size(meson_chip, sels, nsels),
 				  GFP_KERNEL);
 	if (!meson_chip)
 		return -ENOMEM;
-- 
2.21.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ