[PATCH V2] mtd: phram: use div_u64_rem to stop overwrite len in phram_setup

Miquel Raynal miquel.raynal at bootlin.com
Wed Jan 27 07:46:34 EST 2021


On Mon, 2021-01-25 at 12:49:36 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 at huawei.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel



More information about the linux-mtd mailing list