[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <88289a3fb05d777e3683abf8850a8a151c0fff3f.1465975780.git.jslaby@suse.cz>
Date: Wed, 15 Jun 2016 09:31:18 +0200
From: Jiri Slaby <jslaby@...e.cz>
To: stable@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Colin Ian King <colin.king@...onical.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Oliver Neukum <oliver@...kum.org>, Jiri Slaby <jslaby@...e.cz>
Subject: [PATCH 3.12 54/56] pch_phub: return -ENODATA if ROM can't be mapped
From: Colin Ian King <colin.king@...onical.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit a75fa128236bc2fdaa5e412145cbd577e42e14c2 upstream.
The error return err is not initialized for the case when pci_map_rom
fails and no ROM can me mapped. Fix this by setting ret to -ENODATA;
(this is the same error value that is returned if the ROM data is
successfully mapped but does not match the expected ROM signature.).
Issue found from static code analysis using CoverityScan.
Signed-off-by: Colin Ian King <colin.king@...onical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Oliver Neukum <oliver@...kum.org>
Signed-off-by: Jiri Slaby <jslaby@...e.cz>
---
drivers/misc/pch_phub.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/pch_phub.c b/drivers/misc/pch_phub.c
index a5925f7f17f6..829ca77c143e 100644
--- a/drivers/misc/pch_phub.c
+++ b/drivers/misc/pch_phub.c
@@ -512,8 +512,10 @@ static ssize_t pch_phub_bin_read(struct file *filp, struct kobject *kobj,
/* Get Rom signature */
chip->pch_phub_extrom_base_address = pci_map_rom(chip->pdev, &rom_size);
- if (!chip->pch_phub_extrom_base_address)
+ if (!chip->pch_phub_extrom_base_address) {
+ err = -ENODATA;
goto exrom_map_err;
+ }
pch_phub_read_serial_rom(chip, chip->pch_opt_rom_start_address,
(unsigned char *)&rom_signature);
--
2.9.0
Powered by blists - more mailing lists