From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g3JSH-0004qn-6a for barebox@lists.infradead.org; Fri, 21 Sep 2018 11:18:38 +0000 From: Sascha Hauer Date: Fri, 21 Sep 2018 13:18:20 +0200 Message-Id: <20180921111820.29742-9-s.hauer@pengutronix.de> In-Reply-To: <20180921111820.29742-1-s.hauer@pengutronix.de> References: <20180921111820.29742-1-s.hauer@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 8/8] mtd: mtdraw: fix wrong alignment check To: Barebox List The write offset must be raw page size aligned on entry, not page size aligned. Signed-off-by: Sascha Hauer --- drivers/mtd/mtdraw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/mtdraw.c b/drivers/mtd/mtdraw.c index 18a94cc07f..d94629dc41 100644 --- a/drivers/mtd/mtdraw.c +++ b/drivers/mtd/mtdraw.c @@ -196,7 +196,7 @@ static ssize_t mtdraw_write(struct cdev *cdev, const void *buf, size_t count, if (mtdraw->write_fill && mtdraw->write_ofs + mtdraw->write_fill != offset) return -EINVAL; - if (mtdraw->write_fill == 0 && offset - numpage * mtd->writesize != 0) + if (mtdraw->write_fill == 0 && offset - numpage * mtdraw->rps != 0) return -EINVAL; if (mtdraw->write_fill) { -- 2.19.0 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox