Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1238595imu; Wed, 28 Nov 2018 06:43:40 -0800 (PST) X-Google-Smtp-Source: AJdET5eqjWFtEX4JYuwC2IuvOanhjFnB8QgnF5hhOWxsHqlgiPtyMDFnpektbtl/eQkkdQ25EdXp X-Received: by 2002:a62:7f94:: with SMTP id a142mr37942041pfd.96.1543416220269; Wed, 28 Nov 2018 06:43:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543416220; cv=none; d=google.com; s=arc-20160816; b=ohSXCD5kE5BgM7Psh7MTxvAJDBb5PktN1BNLiGcCrKytuSqCJX8K2LhFnaWZ7pJfkk IQicdstW0eAm4rsYYYzrocfGfU56GubEQdfH7LXSgfV31fABucHiMAlJp+T7JONqfIEY xLDsTCx9f08p4GYaoNFicmoFD+0qB7AKoeBoyi82bwbIqB3D6EFmhTlPA2XIFtQ9IJu5 b1SQCx1pcY41p6a8fjQZVEioVH8fM5qbvlPuplOZll5WABLkgfXXmRj4WO68bCYtw9HF 3lDRy3JwNcMmGRY3gSVssRhFG0Xhv+cMwB+VfTzZrqOyYMRa8CkCEP816A1oZs85bLUE eVRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=ppzaK6/Djjm+ST4wmDCZYU+Xkyah/AwGX5Um8kq+eEk=; b=G0uXwkX/9JYSIhyflFEGmpEWNjQS26toTZCHzvz24rGzff69nzzPIKy9jj3klfuOCk vkFQCESX6RpB+2rfclZm5aMXJmeg3auaVSCyxsUYgd4ZaE+SraAE+pAkKbdGNCJHPEiH PT9T9GnT85u90MT/nRJBybz2zQT6H19xdSOE4gzPftgjlSgIw0Lj5BnS4qyl6NEqASGF 2tjc0usGsHJjr+PdzhEdALOXfkrAhsfSF9c8UMjV0Cx83esZ6v8aqfN9AEdaML4CpOwJ rXyPsBskQe7QlDYke4xQIw0il5mMn9gYvqehlpdnT8QyI+ke4SIaEKfsFh3msIXmpIkd mFjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t88-v6si7761355pfk.139.2018.11.28.06.43.24; Wed, 28 Nov 2018 06:43:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728663AbeK2BnQ (ORCPT + 99 others); Wed, 28 Nov 2018 20:43:16 -0500 Received: from mail.bootlin.com ([62.4.15.54]:34139 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727979AbeK2BnQ (ORCPT ); Wed, 28 Nov 2018 20:43:16 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id BD351209A7; Wed, 28 Nov 2018 15:41:21 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.2 Received: from bbrezillon (aaubervilliers-681-1-94-205.w90-88.abo.wanadoo.fr [90.88.35.205]) by mail.bootlin.com (Postfix) with ESMTPSA id 9A36E20791; Wed, 28 Nov 2018 15:41:04 +0100 (CET) Date: Wed, 28 Nov 2018 15:41:04 +0100 From: Boris Brezillon To: Schrempf Frieder Cc: Miquel Raynal , Richard Weinberger , "stable@vger.kernel.org" , David Woodhouse , Brian Norris , Marek Vasut , "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] mtd: nand: Fix memory allocation in nanddev_bbt_init() Message-ID: <20181128154104.577d5923@bbrezillon> In-Reply-To: <1543304637-27308-1-git-send-email-frieder.schrempf@kontron.de> References: <1543304637-27308-1-git-send-email-frieder.schrempf@kontron.de> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Nov 2018 07:44:52 +0000 Schrempf Frieder wrote: > Fix the size of the buffer allocated to store the in-memory BBT. > This bug was previously hidden by a different bug, that was fixed in > d098093ba06e. > > Fixes: 9c3736a3de21 ("mtd: nand: Add core infrastructure to deal with NAND devices") > Cc: > Signed-off-by: Frieder Schrempf Looks like your From header does not match the SoB tag ('Frieder Schrempf' vs 'Schrempf Frieder') and checkpatch does not like that. I'll fix it when applying, but maybe you should fix your .gitconfig to make them match. > --- > drivers/mtd/nand/bbt.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/nand/bbt.c b/drivers/mtd/nand/bbt.c > index 56cde38..c12497f 100644 > --- a/drivers/mtd/nand/bbt.c > +++ b/drivers/mtd/nand/bbt.c > @@ -27,7 +27,8 @@ int nanddev_bbt_init(struct nand_device *nand) > unsigned int nwords = DIV_ROUND_UP(nblocks * bits_per_block, > BITS_PER_LONG); > > - nand->bbt.cache = kzalloc(nwords, GFP_KERNEL); > + nand->bbt.cache = kzalloc(nwords * (BITS_PER_LONG / BITS_PER_BYTE), > + GFP_KERNEL); > if (!nand->bbt.cache) > return -ENOMEM; >