From patchwork Fri Jan 16 20:23:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 5650491 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0EA049F3A0 for ; Fri, 16 Jan 2015 21:32:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A10C20357 for ; Fri, 16 Jan 2015 21:32:07 +0000 (UTC) Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) (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 341492034B for ; Fri, 16 Jan 2015 21:32:06 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t0GLRpT9031262; Fri, 16 Jan 2015 16:27:51 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id t0GLRoUt011879 for ; Fri, 16 Jan 2015 16:27:50 -0500 Received: from redhat.com (ask-08.lab.msp.redhat.com [10.15.85.8]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t0GLRnEo022498; Fri, 16 Jan 2015 16:27:49 -0500 Received: by redhat.com (sSMTP sendmail emulation); Fri, 16 Jan 2015 14:23:45 -0600 From: "Benjamin Marzinski" To: device-mapper development Date: Fri, 16 Jan 2015 14:23:29 -0600 Message-Id: <1421439812-11826-6-git-send-email-bmarzins@redhat.com> In-Reply-To: <1421439812-11826-1-git-send-email-bmarzins@redhat.com> References: <1421439812-11826-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH 5/8] 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",