From: Anil Madhavapeddy Subject: [PATCH] fix segfault in libvchan client error path Date: Wed, 23 Nov 2011 16:14:13 +0000 Message-ID: <20111123161412.GA26454@dark.recoil.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Anil Madhavapeddy # Date 1322064942 0 # Node ID 2934afb3348776eaad57d0d91893f00c862ac507 # Parent 0a0c02a616768bfab16c072788cb76be1893c37f In libvchan_client_init, go to the error path if the gntdev device is not available. Otherwise, a segfault happens later as the vchan context is invalid. Signed-off-by: Anil Madhavapeddy diff -r 0a0c02a61676 -r 2934afb33487 tools/libvchan/init.c --- a/tools/libvchan/init.c Mon Nov 21 21:28:34 2011 +0000 +++ b/tools/libvchan/init.c Wed Nov 23 16:15:42 2011 +0000 @@ -385,7 +385,7 @@ ctrl->gnttab = xc_gnttab_open(logger, 0); if (!ctrl->gnttab) - goto out; + goto fail; // set up event channel if (init_evt_cli(ctrl, domain, logger))