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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1462494716-95312-11-git-send-email-computersforpeace@gmail.com>
Date:	Thu,  5 May 2016 17:31:56 -0700
From:	Brian Norris <computersforpeace@...il.com>
To:	<linux-mtd@...ts.infradead.org>
Cc:	Heiner Kallweit <hkallweit1@...il.com>,
	Brian Norris <computersforpeace@...il.com>,
	Han Xu <han.xu@....com>, Michal Suchanek <hramrach@...il.com>,
	Boris Brezillon <boris.brezillon@...e-electrons.com>,
	Javier Martinez Canillas <javier@....samsung.com>,
	Rafal Milecki <zajec5@...il.com>,
	Jagan Teki <jteki@...nedev.com>,
	"Andrew F. Davis" <afd@...com>,
	Mika Westerberg <mika.westerberg@...ux.intel.com>,
	Gabor Juhos <juhosg@...nwrt.org>,
	Bean Huo <beanhuo@...ron.com>, linux-kernel@...r.kernel.org,
	Bayi Cheng <bayi.cheng@...iatek.com>,
	Joachim Eastwood <manabian@...il.com>,
	Cyrille Pitchen <cyrille.pitchen@...el.com>
Subject: [PATCH v7 10/10] mtd: m25p80: read in spi_max_transfer_size chunks

From: Michal Suchanek <hramrach@...il.com>

Take into account transfer size limitation of SPI master.

Signed-off-by: Michal Suchanek <hramrach@...il.com>
Signed-off-by: Brian Norris <computersforpeace@...il.com>
---
v6 -> v7:
 * use min() instead of min_t()

 drivers/mtd/devices/m25p80.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index eab46d211ae6..9cf7fcd28034 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -172,7 +172,7 @@ static ssize_t m25p80_read(struct spi_nor *nor, loff_t from, size_t len,
 
 	t[1].rx_buf = buf;
 	t[1].rx_nbits = m25p80_rx_nbits(nor);
-	t[1].len = len;
+	t[1].len = min(len, spi_max_transfer_size(spi));
 	spi_message_add_tail(&t[1], &m);
 
 	ret = spi_sync(spi, &m);
-- 
2.8.0.rc3.226.g39d4020

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ