Skip to content

Commit 453da98

Browse files
Michael Schmitzdavem330
authored andcommitted
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>
1 parent caaf45a commit 453da98

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/ethernet/8390/ax88796.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,7 @@ static int ax_remove(struct platform_device *pdev)
826826
release_mem_region(mem->start, resource_size(mem));
827827
}
828828

829+
platform_set_drvdata(pdev, NULL);
829830
free_netdev(dev);
830831

831832
return 0;
@@ -959,6 +960,7 @@ static int ax_probe(struct platform_device *pdev)
959960
release_mem_region(mem->start, mem_size);
960961

961962
exit_mem:
963+
platform_set_drvdata(pdev, NULL);
962964
free_netdev(dev);
963965

964966
return ret;

0 commit comments

Comments
 (0)