From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 2/7] xen/arm: Implement hip04-d01 platform Date: Tue, 04 Nov 2014 14:23:49 +0000 Message-ID: <5458E175.40409@linaro.org> References: <1415033196-30529-1-git-send-email-frediano.ziglio@huawei.com> <1415033196-30529-3-git-send-email-frediano.ziglio@huawei.com> <5458D2C5.7050900@linaro.org> <5458DCC9.9090406@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Frediano Ziglio , Ian Campbell , Stefano Stabellini , Tim Deegan Cc: Zoltan Kiss , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 11/04/2014 02:17 PM, Frediano Ziglio wrote: >> If you really want to keep the *p = NULL. This could be simplify into: >> >> hip04_iounmap(....) >> { >> iounmap(*p); >> *p = NULL; >> } >> >> This is because iounmap takes care of NULL pointer. >> > > Are you sure? I looked at code and is not a simple vm_free call, it does some mapping even if address is NULL. Yes, vm_size(va) will return 0 and destroy_xen_mappings won't unmap anything because start == end. I agree that an explicit check in vunmap would be nice. Regards, -- Julien Grall