From patchwork Sun Mar 8 03:31:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 5961201 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 40C21BF440 for ; Sun, 8 Mar 2015 04:40:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 486C5203AF for ; Sun, 8 Mar 2015 04:40:07 +0000 (UTC) Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3C9E920251 for ; Sun, 8 Mar 2015 04:40:06 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t284aYSA006967; Sat, 7 Mar 2015 23:36:34 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id t284ZUmU009367 for ; Sat, 7 Mar 2015 23:35:30 -0500 Received: from redhat.com (ask-08.lab.msp.redhat.com [10.15.85.8]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t284ZSjD013283; Sat, 7 Mar 2015 23:35:28 -0500 Received: by redhat.com (sSMTP sendmail emulation); Sat, 07 Mar 2015 21:31:55 -0600 From: "Benjamin Marzinski" To: device-mapper development Date: Sat, 7 Mar 2015 21:31:36 -0600 Message-Id: <1425785506-20419-6-git-send-email-bmarzins@redhat.com> In-Reply-To: <1425785506-20419-1-git-send-email-bmarzins@redhat.com> References: <1425785506-20419-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-loop: dm-devel@redhat.com Cc: Christophe Varoqui Subject: [dm-devel] [PATCH 05/15] multipathd: fix memory corruption issue X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP setup_multipath already removes the mpp if it fails, so we shouldn't be accessing the mpp at all if it fails, and especially not freeing it. Signed-off-by: Benjamin Marzinski --- multipathd/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/multipathd/main.c b/multipathd/main.c index 3afed62..a194c80 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -657,9 +657,8 @@ ev_remove_path (struct path *pp, struct vectors * vecs) /* * update our state from kernel */ - if (setup_multipath(vecs, mpp)) { - goto fail; - } + if (setup_multipath(vecs, mpp)) + return 1; sync_map_state(mpp); condlog(2, "%s [%s]: path removed from map %s",