Commit 0b4bc246 authored by Mathis MARION's avatar Mathis MARION Committed by Federico Vaga

Set fwnode to NULL after deallocation

dev.fwnode was not set to NULL after deallocation which could wrong
memory accesses.
Signed-off-by: 's avatarMathis MARION <mathis.marion@grenoble-inp.org>
parent 16b7b936
......@@ -320,6 +320,7 @@ static int htvic_irq_mapping(struct htvic_device *htvic)
&htvic_irq_domain_ops, htvic);
if (!htvic->domain) {
irq_domain_free_fwnode(htvic->pdev->dev.fwnode);
htvic->pdev->dev.fwnode = NULL;
return -ENOMEM;
}
#else
......@@ -353,6 +354,7 @@ out:
irq_domain_remove(htvic->domain);
#if KERNEL_VERSION(4, 4, 0) <= LINUX_VERSION_CODE
irq_domain_free_fwnode(htvic->pdev->dev.fwnode);
htvic->pdev->dev.fwnode = NULL;
#endif
return -EPERM;
}
......@@ -607,6 +609,7 @@ static int htvic_remove(struct platform_device *pdev)
irq_domain_remove(htvic->domain);
#if KERNEL_VERSION(4, 4, 0) <= LINUX_VERSION_CODE
irq_domain_free_fwnode(htvic->pdev->dev.fwnode);
htvic->pdev->dev.fwnode = NULL;
#endif
kfree(htvic);
dev_set_drvdata(&pdev->dev, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment