From 18481e2ea6f62ff06c359aa4dc6debe2e5b53561 Mon Sep 17 00:00:00 2001 From: Ralph Metzler Date: Fri, 25 Sep 2015 17:45:48 +0200 Subject: [PATCH] destroy attribute devices earlier to prevent accesses after I2C devices are already gone --- ddbridge/octonet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ddbridge/octonet.c b/ddbridge/octonet.c index 1bec01c..05efed8 100644 --- a/ddbridge/octonet.c +++ b/ddbridge/octonet.c @@ -113,6 +113,8 @@ static int __exit octonet_remove(struct platform_device *pdev) dev = platform_get_drvdata(pdev); + ddb_device_destroy(dev); + ddb_nsd_detach(dev); ddb_ports_detach(dev); ddb_i2c_release(dev); @@ -122,7 +124,6 @@ static int __exit octonet_remove(struct platform_device *pdev) free_irq(platform_get_irq(dev->pfdev, 0), dev); ddb_ports_release(dev); - ddb_device_destroy(dev); octonet_unmap(dev); platform_set_drvdata(pdev, 0); return 0;