mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
starfire: clean up properly if firmware loading fails
commit c928febf4b upstream.
netdev_open() will return without cleaning up net device or hardware state
if firmware loading fails. This results in a BUG() on a second attempt to
bring the interface up, reported in
<http://bugzilla.kernel.org/show_bug.cgi?id=15091>, and probably has even
worse effects if the driver is removed afterwards.
Call netdev_close() to clean up on failure.
Addresses http://bugzilla.kernel.org/show_bug.cgi?id=15091
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Reported-by: Michael Moffatt <michael@moffatt.org.nz>
Tested-by: Michael Moffatt <michael@moffatt.org.nz>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
906f68dd91
commit
35cfb03de1
@@ -1063,7 +1063,7 @@ static int netdev_open(struct net_device *dev)
|
||||
if (retval) {
|
||||
printk(KERN_ERR "starfire: Failed to load firmware \"%s\"\n",
|
||||
FIRMWARE_RX);
|
||||
return retval;
|
||||
goto out_init;
|
||||
}
|
||||
if (fw_rx->size % 4) {
|
||||
printk(KERN_ERR "starfire: bogus length %zu in \"%s\"\n",
|
||||
@@ -1108,6 +1108,9 @@ out_tx:
|
||||
release_firmware(fw_tx);
|
||||
out_rx:
|
||||
release_firmware(fw_rx);
|
||||
out_init:
|
||||
if (retval)
|
||||
netdev_close(dev);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user