mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-18 21:14:28 +00:00
net-next: ax88796: release platform device drvdata on probe error and 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>
This commit is contained in:
parent
caaf45a6ba
commit
453da98878
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue