From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Egger, Christoph" Subject: Re: [PATCH 3/5] tools/mce: use calloc() instead of malloc()/memset() in xen-mceinj Date: Tue, 24 Jun 2014 10:14:45 +0200 Message-ID: <53A93375.6030303@amazon.de> References: <1403546221-4149-1-git-send-email-david.vrabel@citrix.com> <1403546221-4149-4-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WzLsw-0000AV-5B for xen-devel@lists.xenproject.org; Tue, 24 Jun 2014 08:15:22 +0000 In-Reply-To: <1403546221-4149-4-git-send-email-david.vrabel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel , xen-devel@lists.xenproject.org Cc: Liu Jinsong , Ian Jackson , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 23.06.14 19:56, David Vrabel wrote: > Signed-off-by: David Vrabel Acked-by: Christoph Egger > --- > tools/tests/mce-test/tools/xen-mceinj.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/tools/tests/mce-test/tools/xen-mceinj.c b/tools/tests/mce-test/tools/xen-mceinj.c > index 51ca175..d4f889b 100644 > --- a/tools/tests/mce-test/tools/xen-mceinj.c > +++ b/tools/tests/mce-test/tools/xen-mceinj.c > @@ -284,10 +284,9 @@ static uint64_t guest_mfn(xc_interface *xc_handle, > err(xc_handle, "Failed to get platform information"); > > /* Get guest's pfn list */ > - pfn_buf = malloc(sizeof(uint64_t) * max_gpfn); > + pfn_buf = calloc(max_gpfn, sizeof(uint64_t)); > if ( !pfn_buf ) > err(xc_handle, "Failed to alloc pfn buf"); > - memset(pfn_buf, 0, sizeof(uint64_t) * max_gpfn); > > ret = xc_get_pfn_list(xc_handle, domain, pfn_buf, max_gpfn); > if ( ret < 0 ) { >