[PATCH 3.12 044/235] ssb: Fix error routine when fallback SPROM fails

From: Jiri Slaby
Date: Fri Jan 27 2017 - 05:59:54 EST

From: Larry Finger <Larry.Finger@xxxxxxxxxxxx>

3.12-stable review patch. If anyone has any objections, please let me know.


commit 8052d7245b6089992343c80b38b14dbbd8354651 upstream.

When there is a CRC error in the SPROM read from the device, the code
attempts to handle a fallback SPROM. When this also fails, the driver
returns zero rather than an error code.

Signed-off-by: Larry Finger <Larry.Finger@xxxxxxxxxxxx>
Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxxxxxx>
Signed-off-by: Jiri Slaby <jslaby@xxxxxxx>
drivers/ssb/pci.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c
index a8dc95ebf2d6..7700cef5e177 100644
--- a/drivers/ssb/pci.c
+++ b/drivers/ssb/pci.c
@@ -846,6 +846,7 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus,
if (err) {
ssb_warn("WARNING: Using fallback SPROM failed (err %d)\n",
+ goto out_free;
} else {
ssb_dbg("Using SPROM revision %d provided by platform\n",