The net device struct pointer is stored as platform device drvdata on
module probe - clear the drvdata entry on probe fail there, as well as
when unloading the module.

Signed-off-by: Michael Schmitz <schmitz...@gmail.com>
---
 drivers/net/ethernet/8390/ax88796.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/8390/ax88796.c 
b/drivers/net/ethernet/8390/ax88796.c
index a72dfbc..eb72282 100644
--- a/drivers/net/ethernet/8390/ax88796.c
+++ b/drivers/net/ethernet/8390/ax88796.c
@@ -829,6 +829,7 @@ static int ax_remove(struct platform_device *pdev)
                release_mem_region(mem->start, resource_size(mem));
        }
 
+       platform_set_drvdata(pdev, NULL);
        free_netdev(dev);
 
        return 0;
@@ -962,6 +963,7 @@ static int ax_probe(struct platform_device *pdev)
        release_mem_region(mem->start, mem_size);
 
  exit_mem:
+       platform_set_drvdata(pdev, NULL);
        free_netdev(dev);
 
        return ret;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to