From: Ian Jackson Subject: [PATCH 11/11] mini-os/xenbus: Provide xenbus_free Date: Fri, 20 Jun 2014 20:04:50 +0100 Message-ID: <1403291090-8657-12-git-send-email-ian.jackson@eu.citrix.com> References: <1403291090-8657-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wy47V-0000qZ-3T for xen-devel@lists.xenproject.org; Fri, 20 Jun 2014 19:05:05 +0000 In-Reply-To: <1403291090-8657-1-git-send-email-ian.jackson@eu.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: xen-devel@lists.xenproject.org Cc: Keir Fraser , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org Signed-off-by: Ian Jackson --- include/mini-os/xenbus.h | 5 +++++ xen/xenbus/xenbus.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/include/mini-os/xenbus.h b/include/mini-os/xenbus.h index 1900e55..0e45d47 100644 --- a/include/mini-os/xenbus.h +++ b/include/mini-os/xenbus.h @@ -199,6 +199,11 @@ void xenbus_watch_release(struct xenbus_watch *watch); /* idempotent */ void xenbus_xb_write(int type, int req_id, xenbus_transaction_t trans_id, const struct write_req *req, int nr_reqs); +void xenbus_free(void*); +/* If the caller is in a scope which uses a different malloc arena, + * it must use this rather than free() when freeing data received + * from xenbus. */ + #ifdef CONFIG_XENBUS /* Reset the XenBus system. */ void fini_xenbus(void); diff --git a/xen/xenbus/xenbus.c b/xen/xenbus/xenbus.c index e5d7f36..77b9603 100644 --- a/xen/xenbus/xenbus.c +++ b/xen/xenbus/xenbus.c @@ -539,6 +539,8 @@ xenbus_msg_reply(int type, return rep; } +void xenbus_free(void *p) { free(p); } + static char *errmsg(struct xsd_sockmsg *rep) { char *res; -- 1.7.10.4