From: Sebastian Ott <sebott@linux.vnet.ibm.com>
Date: Tue, 16 Apr 2013 12:18:41 +0000 (+0200)
Subject: s390/pci: return error after failed pci ops
X-Git-Tag: firefly_0821_release~3680^2~683^2~19
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2c3700bbb2c9c9c1d10f930d400f573d55f8e750;p=firefly-linux-kernel-4.4.55.git

s390/pci: return error after failed pci ops

Access to pci config space via pci_ops should not fail silently.

Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index 51d16f1fb5ea..6a054bf83eb0 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -405,20 +405,28 @@ static int pci_read(struct pci_bus *bus, unsigned int devfn, int where,
 		    int size, u32 *val)
 {
 	struct zpci_dev *zdev = get_zdev_by_bus(bus);
+	int ret;
 
 	if (!zdev || devfn != ZPCI_DEVFN)
-		return 0;
-	return zpci_cfg_load(zdev, where, val, size);
+		ret = -ENODEV;
+	else
+		ret = zpci_cfg_load(zdev, where, val, size);
+
+	return ret;
 }
 
 static int pci_write(struct pci_bus *bus, unsigned int devfn, int where,
 		     int size, u32 val)
 {
 	struct zpci_dev *zdev = get_zdev_by_bus(bus);
+	int ret;
 
 	if (!zdev || devfn != ZPCI_DEVFN)
-		return 0;
-	return zpci_cfg_store(zdev, where, val, size);
+		ret = -ENODEV;
+	else
+		ret = zpci_cfg_store(zdev, where, val, size);
+
+	return ret;
 }
 
 static struct pci_ops pci_root_ops = {