diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2010-11-03 18:28:45 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-16 16:37:03 -0500 |
commit | ca4a0831917d6541b45f03542257fcb20dc9cf4a (patch) | |
tree | 7a624ee91b1137e941a13e0899c2f2581e61769e /drivers/ssb | |
parent | 54435f9ec837cf0bb0ea02a2bb6362a6aaef5250 (diff) |
ssb: return -ENOMEM on alloc fail (instead of CRC check's result)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/ssb')
-rw-r--r-- | drivers/ssb/pci.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c index 3226832df32d..b5343ac37ee5 100644 --- a/drivers/ssb/pci.c +++ b/drivers/ssb/pci.c | |||
@@ -619,7 +619,7 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus, | |||
619 | struct ssb_sprom *sprom) | 619 | struct ssb_sprom *sprom) |
620 | { | 620 | { |
621 | const struct ssb_sprom *fallback; | 621 | const struct ssb_sprom *fallback; |
622 | int err = -ENOMEM; | 622 | int err; |
623 | u16 *buf; | 623 | u16 *buf; |
624 | 624 | ||
625 | if (!ssb_is_sprom_available(bus)) { | 625 | if (!ssb_is_sprom_available(bus)) { |
@@ -646,7 +646,7 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus, | |||
646 | 646 | ||
647 | buf = kcalloc(SSB_SPROMSIZE_WORDS_R123, sizeof(u16), GFP_KERNEL); | 647 | buf = kcalloc(SSB_SPROMSIZE_WORDS_R123, sizeof(u16), GFP_KERNEL); |
648 | if (!buf) | 648 | if (!buf) |
649 | goto out; | 649 | return -ENOMEM; |
650 | bus->sprom_size = SSB_SPROMSIZE_WORDS_R123; | 650 | bus->sprom_size = SSB_SPROMSIZE_WORDS_R123; |
651 | sprom_do_read(bus, buf); | 651 | sprom_do_read(bus, buf); |
652 | err = sprom_check_crc(buf, bus->sprom_size); | 652 | err = sprom_check_crc(buf, bus->sprom_size); |
@@ -656,7 +656,7 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus, | |||
656 | buf = kcalloc(SSB_SPROMSIZE_WORDS_R4, sizeof(u16), | 656 | buf = kcalloc(SSB_SPROMSIZE_WORDS_R4, sizeof(u16), |
657 | GFP_KERNEL); | 657 | GFP_KERNEL); |
658 | if (!buf) | 658 | if (!buf) |
659 | goto out; | 659 | return -ENOMEM; |
660 | bus->sprom_size = SSB_SPROMSIZE_WORDS_R4; | 660 | bus->sprom_size = SSB_SPROMSIZE_WORDS_R4; |
661 | sprom_do_read(bus, buf); | 661 | sprom_do_read(bus, buf); |
662 | err = sprom_check_crc(buf, bus->sprom_size); | 662 | err = sprom_check_crc(buf, bus->sprom_size); |
@@ -678,7 +678,6 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus, | |||
678 | 678 | ||
679 | out_free: | 679 | out_free: |
680 | kfree(buf); | 680 | kfree(buf); |
681 | out: | ||
682 | return err; | 681 | return err; |
683 | } | 682 | } |
684 | 683 | ||