Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a35ab937 authored by Nathan Hintz's avatar Nathan Hintz Committed by John W. Linville
Browse files

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: default avatarNathan Hintz <nlhintz@hotmail.com>
Acked-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent f6734627
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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.
		 */