mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 23:21:46 +00:00
devres: fix possible use after free
devres uses the pointer value as key after it's freed, which is safe but triggers spurious use-after-free warnings on some static analysis tools. Rearrange code to avoid such warnings. Signed-off-by: Maxin B. John <maxin.john@gmail.com> Reviewed-by: Rolf Eike Beer <eike-kernel@sf-tec.de> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
5190f0c030
commit
ae891a1b93
3 changed files with 3 additions and 3 deletions
|
@ -79,9 +79,9 @@ EXPORT_SYMBOL(devm_ioremap_nocache);
|
|||
*/
|
||||
void devm_iounmap(struct device *dev, void __iomem *addr)
|
||||
{
|
||||
iounmap(addr);
|
||||
WARN_ON(devres_destroy(dev, devm_ioremap_release, devm_ioremap_match,
|
||||
(void *)addr));
|
||||
iounmap(addr);
|
||||
}
|
||||
EXPORT_SYMBOL(devm_iounmap);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue