summaryrefslogtreecommitdiffstats
path: root/drivers/misc/pch_phub.c
diff options
context:
space:
mode:
authorColin Ian King2016-02-27 15:52:22 +0100
committerGreg Kroah-Hartman2016-03-05 21:19:39 +0100
commita75fa128236bc2fdaa5e412145cbd577e42e14c2 (patch)
treee24d74c9d691ca78a5a683c720f30dbcec00ba99 /drivers/misc/pch_phub.c
parentDrivers: hv: vmbus: Support kexec on ws2012 r2 and above (diff)
downloadkernel-qcow2-linux-a75fa128236bc2fdaa5e412145cbd577e42e14c2.tar.gz
kernel-qcow2-linux-a75fa128236bc2fdaa5e412145cbd577e42e14c2.tar.xz
kernel-qcow2-linux-a75fa128236bc2fdaa5e412145cbd577e42e14c2.zip
pch_phub: return -ENODATA if ROM can't be mapped
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@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/pch_phub.c')
-rw-r--r--drivers/misc/pch_phub.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/misc/pch_phub.c b/drivers/misc/pch_phub.c
index 15bb0c8cdda3..4810e039bbec 100644
--- a/drivers/misc/pch_phub.c
+++ b/drivers/misc/pch_phub.c
@@ -513,8 +513,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);