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]
Date:   Fri, 2 Mar 2018 21:00:39 +0100 (CET)
From:   Julia Lawall <julia.lawall@...6.fr>
To:     Miquel Raynal <miquel.raynal@...tlin.com>
cc:     Boris Brezillon <boris.brezillon@...e-electrons.com>,
        Richard Weinberger <richard@....at>,
        David Woodhouse <dwmw2@...radead.org>,
        Brian Norris <computersforpeace@...il.com>,
        Marek Vasut <marek.vasut@...il.com>,
        Cyrille Pitchen <cyrille.pitchen@...ev4u.fr>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        linux-kernel@...r.kernel.org, linux-mtd@...ts.infradead.org,
        kbuild-all@...org
Subject: [PATCH] mtd: rawnand: fix memdup.cocci warnings

From: Fengguang Wu <fengguang.wu@...el.com>

 Use kmemdup rather than duplicating its implementation

Generated by: scripts/coccinelle/api/memdup.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
Signed-off-buy: Julia Lawall <julia.lawall@...6.fr>
---

tree:   https://github.com/bbrezillon/linux-0day mraynal/nand-scan
head:   0fdb0ec57e123aae03d1c52f8ba5fb6c8c8f98ed
commit: d4d20cd03273ee0d1bb874dc33170286216b6320 [70/71] mtd: rawnand: do
not export nand_scan_[ident|tail]() anymore

 nand_base.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -5160,13 +5160,12 @@ static int nand_flash_detect_onfi(struct

 	sanitize_string(p->manufacturer, sizeof(p->manufacturer));
 	sanitize_string(p->model, sizeof(p->model));
-	model = kzalloc(sizeof(p->model), GFP_KERNEL);
+	model = kmemdup(p->model, sizeof(p->model), GFP_KERNEL);
 	if (!model) {
 		ret = -ENOMEM;
 		goto free_onfi_param_page;
 	}

-	memcpy(model, p->model, sizeof(p->model));
 	chip->parameters.model = model;
 	if (!mtd->name)
 		mtd->name = chip->parameters.model;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ