]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
mtd: spi-nor: fix silent truncation in spi_nor_read()
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Wed, 30 Oct 2019 18:48:59 +0000 (21:48 +0300)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 06:00:53 +0000 (01:00 -0500)
commitc40e34b35848086cb522f58a70200d25fb090dc5
tree162c65d8523d12ac5209ef68acc032b33cb6d51f
parentffae32d9d70f33051f4b64f92b23eb4d2d7d0214
mtd: spi-nor: fix silent truncation in spi_nor_read()

BugLink: https://bugs.launchpad.net/bugs/1862227
commit a719a75a7761e4139dd099330d9fe3589d844f9b upstream.

spi_nor_read() assigns the result of 'ssize_t spi_nor_read_data()'
to the 'int ret' variable, while 'ssize_t' is a 64-bit type and *int*
is a 32-bit type on the 64-bit machines. This silent truncation isn't
really valid, so fix up the variable's type.

Fixes: 59451e1233bd ("mtd: spi-nor: change return value of read/write")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/mtd/spi-nor/spi-nor.c