summaryrefslogtreecommitdiffstats
path: root/drivers/bcma/driver_pci_host.c
diff options
context:
space:
mode:
authorNathan Hintz <nlhintz@hotmail.com>2013-01-12 11:46:14 +0100
committerJohn W. Linville <linville@tuxdriver.com>2013-01-14 21:10:40 +0100
commita35ab937cb27ec8c00b6f13cade93dc10e22b670 (patch)
tree39cf0395c40c2b39f7ed0247744767559da3c163 /drivers/bcma/driver_pci_host.c
parentbcma: delete duplicate readl (diff)
downloadlinux-a35ab937cb27ec8c00b6f13cade93dc10e22b670.tar.xz
linux-a35ab937cb27ec8c00b6f13cade93dc10e22b670.zip
bcma: jump to 'out' label for invalid 'func' value
Consistently jump to the 'out' label for error conditions (adds missing check for 'func' validity in bcma_extpci_write_config). Signed-off-by: Nathan Hintz <nlhintz@hotmail.com> Acked-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma/driver_pci_host.c')
-rw-r--r--drivers/bcma/driver_pci_host.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/bcma/driver_pci_host.c b/drivers/bcma/driver_pci_host.c
index cf3dca987257..4a4152389515 100644
--- a/drivers/bcma/driver_pci_host.c
+++ b/drivers/bcma/driver_pci_host.c
@@ -94,7 +94,7 @@ static int bcma_extpci_read_config(struct bcma_drv_pci *pc, unsigned int dev,
if (dev == 0) {
/* we support only two functions on device 0 */
if (func > 1)
- return -EINVAL;
+ goto out;
/* accesses to config registers with offsets >= 256
* requires indirect access.
@@ -157,6 +157,10 @@ static int bcma_extpci_write_config(struct bcma_drv_pci *pc, unsigned int dev,
if (unlikely(len != 1 && len != 2 && len != 4))
goto out;
if (dev == 0) {
+ /* we support only two functions on device 0 */
+ if (func > 1)
+ goto out;
+
/* accesses to config registers with offsets >= 256
* requires indirect access.
*/