Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1711651

[PATCH 4.12 11/65] mtd: nand: Declare tBERS, tR and tPROG as u64 to avoid integer overflow

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.12 11/65] mtd: nand: Declare tBERS, tR and tPROG as u64 to avoid integer overflow
Date 2017-08-15 03:40 +0200
Message-ID <ueyZP-3cJ-3@gated-at.bofh.it> (permalink)
References <ueyQ9-39h-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Boris Brezillon <boris.brezillon@free-electrons.com>

commit 6d29231000bbe0fb9e4893a9c68151ffdd3b5469 upstream.

All timings in nand_sdr_timings are expressed in picoseconds but some
of them may not fit in an u32.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Fixes: 204e7ecd47e2 ("mtd: nand: Add a few more timings to nand_sdr_timings")
Reported-by: Alexander Dahl <ada@thorsis.com>
Reviewed-by: Alexander Dahl <ada@thorsis.com>
Tested-by: Alexander Dahl <ada@thorsis.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mtd/nand/nand_timings.c |    6 +++---
 include/linux/mtd/nand.h        |    6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/mtd/nand/nand_timings.c
+++ b/drivers/mtd/nand/nand_timings.c
@@ -311,9 +311,9 @@ int onfi_init_data_interface(struct nand
 		struct nand_sdr_timings *timings = &iface->timings.sdr;
 
 		/* microseconds -> picoseconds */
-		timings->tPROG_max = 1000000UL * le16_to_cpu(params->t_prog);
-		timings->tBERS_max = 1000000UL * le16_to_cpu(params->t_bers);
-		timings->tR_max = 1000000UL * le16_to_cpu(params->t_r);
+		timings->tPROG_max = 1000000ULL * le16_to_cpu(params->t_prog);
+		timings->tBERS_max = 1000000ULL * le16_to_cpu(params->t_bers);
+		timings->tR_max = 1000000ULL * le16_to_cpu(params->t_r);
 
 		/* nanoseconds -> picoseconds */
 		timings->tCCS_min = 1000UL * le16_to_cpu(params->t_ccs);
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -638,10 +638,10 @@ struct nand_buffers {
  * @tWW_min: WP# transition to WE# low
  */
 struct nand_sdr_timings {
-	u32 tBERS_max;
+	u64 tBERS_max;
 	u32 tCCS_min;
-	u32 tPROG_max;
-	u32 tR_max;
+	u64 tPROG_max;
+	u64 tR_max;
 	u32 tALH_min;
 	u32 tADL_min;
 	u32 tALS_min;

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.12 00/65] 4.12.8-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:30 +0200
  [PATCH 4.12 36/65] staging: comedi: comedi_fops: do not call blocking ops when !TASK_RUNNING Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:30 +0200
  [PATCH 4.12 62/65] MIPS: DEC: Fix an int-handler.S CPU_DADDI_WORKAROUNDS regression Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:30 +0200
  [PATCH 4.12 53/65] pnfs/blocklayout: require 64-bit sector_t Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:30 +0200
  [PATCH 4.12 31/65] iio: accel: st_accel: add SPI-3wire support Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:30 +0200
  [PATCH 4.12 45/65] usb: core: unlink urbs from the tail of the endpoints urb_list Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:30 +0200
  [PATCH 4.12 29/65] staging:iio:resolver:ad2s1210 fix negative IIO_ANGL_VEL read Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:30 +0200
  [PATCH 4.12 09/65] mtd: nand: atmel: Fix DT backward compatibility in pmecc.c Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:30 +0200
  [PATCH 4.12 58/65] pinctrl: uniphier: fix WARN_ON() of pingroups dump on LD20 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:30 +0200
  [PATCH 4.12 30/65] iio: aspeed-adc: wait for initial sequence. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:30 +0200
  [PATCH 4.12 24/65] USB: serial: option: add D-Link DWM-222 device ID Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 11/65] mtd: nand: Declare tBERS, tR and tPROG as u64 to avoid integer overflow Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 03/65] futex: Remove unnecessary warning from get_futex_key Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 26/65] USB: serial: pl2303: add new ATEN device id Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 07/65] xfs: Fix leak of discard bio Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 02/65] mm: fix list corruptions on shmem shrinklist Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 17/65] i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 05/65] xtensa: mm/cache: add missing EXPORT_SYMBOLs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 06/65] xtensa: dont limit csum_partial export by CONFIG_NET Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 23/65] drm/i915: Fix out-of-bounds array access in bdw_load_gamma_lut Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 21/65] drm/bridge: tc358767: fix probe without attached output node Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 20/65] nfs/flexfiles: fix leak of nfs4_ff_ds_version arrays Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 16/65] fuse: initialize the flock flag in fuse_file on allocation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 12/65] iscsi-target: fix memory leak in iscsit_setup_text_cmd() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 15/65] target: Fix node_acl demo-mode + uncached dynamic shutdown regression Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 18/65] nand: fix wrong default oob layout for small pages using soft ecc Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 01/65] mm: ratelimit PFNs busy info message Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 08/65] pinctrl: armada-37xx: Fix number of pin in south bridge Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 13/65] iscsi-target: Fix iscsi_np reset hung task during parallel delete Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 27/65] usb: musb: fix tx fifo flush handling again Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 19/65] mmc: mmc: correct the logic for setting HS400ES signal voltage Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 22/65] drm/etnaviv: Fix off-by-one error in reloc checking Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 04/65] xtensa: fix cache aliasing handling code for WT cache Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  [PATCH 4.12 14/65] usb-storage: fix deadlock involving host lock and scsi_done Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 03:40 +0200
  Re: [PATCH 4.12 00/65] 4.12.8-stable review Guenter Roeck <linux@roeck-us.net> - 2017-08-15 12:50 +0200
    Re: [PATCH 4.12 00/65] 4.12.8-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 16:40 +0200
  Re: [PATCH 4.12 00/65] 4.12.8-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-08-15 20:10 +0200
    Re: [PATCH 4.12 00/65] 4.12.8-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-15 20:20 +0200

csiph-web