Skip to content

Commit

Permalink
bcma: jump to 'out' label for invalid 'func' value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nathan Hintz authored and John W. Linville committed Jan 14, 2013
1 parent f673462 commit a35ab93
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/bcma/driver_pci_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
*/
Expand Down

0 comments on commit a35ab93

Please sign in to comment.