From: Alexey Khoroshilov <khoroshilov@ispras.ru>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>,
linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org
Subject: Is iounmap(NULL) safe or not?
Date: Sat, 6 May 2017 01:50:08 +0300 [thread overview]
Message-ID: <1494024608-10343-1-git-send-email-khoroshilov@ispras.ru> (raw)
Hello,
It seems thare are many places where code assumes iounmap(NULL) is safe.
Also there are several patches that state it explicitly:
ff6defa6a8fa ("ALSA: Deletion of checks before the function call "iounmap")
e24bb0ed8179 ("staging: dgnc: remove NULL test")
At the same time it seems PPC implementation generates a warning in this case:
3bfafd6b136b ("netxen: avoid invalid iounmap")
arch/powerpc/mm/pgtable_64.c:
if ((unsigned long)addr < ioremap_bot) {
printk(KERN_WARNING "Attempt to iounmap early bolted mapping"
" at 0x%p\n", addr);
return;
}
Could you please clarify if iounmap(NULL) safe or not.
I guess it would be less errorprone if the answer is architecture independent.
--
Thank you,
Alexey Khoroshilov
Linux Verification Center, ISPRAS
web: http://linuxtesting.org
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2017-05-05 22:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-05 22:50 Alexey Khoroshilov [this message]
2017-05-06 7:47 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1494024608-10343-1-git-send-email-khoroshilov@ispras.ru \
--to=khoroshilov@ispras.ru \
--cc=benh@kernel.crashing.org \
--cc=gregkh@linuxfoundation.org \
--cc=ldv-project@linuxtesting.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox