Skip to content

Commit

Permalink
net-next: ax88796: release platform device drvdata on probe error and…
Browse files Browse the repository at this point in the history
… module remove

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 <schmitzmic@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michael Schmitz authored and David S. Miller committed Apr 19, 2018
1 parent caaf45a commit 453da98
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/8390/ax88796.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,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;
Expand Down Expand Up @@ -959,6 +960,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;
Expand Down

0 comments on commit 453da98

Please sign in to comment.