]> git.proxmox.com Git - mirror_ubuntu-bionic-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 05:29:37 +0000 (00:29 -0500)
commitddbd38aa67fbd038bb519266270842de8eba4d7f
tree74d444099ae2acc09963b204700a4f08dfc025a5
parenta361843af7d0ddaaa6d1ace024c0caec0fe1c7f3
mtd: spi-nor: fix silent truncation in spi_nor_read()

BugLink: https://bugs.launchpad.net/bugs/1861934
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