public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: yangerkun <yangerkun@huawei.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
	<zhongguohua1@huawei.com>, <joern@lazybastard.org>,
	<richard@nod.at>, <patrick@baymotion.com>,
	<linux-mtd@lists.infradead.org>
Subject: Re: [PATCH] mtd: phram: use div_u64_rem to stop overwrite len in phram_setup
Date: Mon, 25 Jan 2021 13:48:32 +0800	[thread overview]
Message-ID: <01746715-84dc-cd7a-508a-52ba3172e339@huawei.com> (raw)
In-Reply-To: <20210104101830.3036-1-miquel.raynal@bootlin.com>

Hi,

Recheck the patch, and it seems we need check erasesize to prevent DIV/0...

Sorry for the mistake. Can you add a fix patch for this?

Thanks,
Kun.

在 2021/1/4 18:18, Miquel Raynal 写道:
> On Wed, 2020-12-30 at 02:17:18 UTC, yangerkun wrote:
>> We now support user to set erase page size, and use do_div between len
>> and erase size to determine the reasonableness for the erase size.
>> However, do_div is a macro and will overwrite the value of len. Which
>> results a mtd device with unexcepted size. Fix it by use div_u64_rem.
>>
>> Fixes: ffad560394de ("mtd: phram: Allow the user to set the erase page size.")
>> Signed-off-by: yangerkun <yangerkun@huawei.com>
> 
> Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.
> 
> Miquel
> .
> 

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2021-01-25  5:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30  2:17 [PATCH] mtd: phram: use div_u64_rem to stop overwrite len in phram_setup yangerkun
2021-01-04 10:08 ` Miquel Raynal
2021-01-04 10:18 ` Miquel Raynal
2021-01-25  5:48   ` yangerkun [this message]
2021-01-25  8:28     ` Miquel Raynal
2021-01-25  8:36       ` yangerkun
2021-01-25  8:53         ` Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01746715-84dc-cd7a-508a-52ba3172e339@huawei.com \
    --to=yangerkun@huawei.com \
    --cc=joern@lazybastard.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=patrick@baymotion.com \
    --cc=richard@nod.at \
    --cc=zhongguohua1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox