From patchwork Tue Feb 4 12:18:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Domke X-Patchwork-Id: 3575621 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2C2A29F382 for ; Tue, 4 Feb 2014 12:19:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 62F5320163 for ; Tue, 4 Feb 2014 12:19:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 141D52015E for ; Tue, 4 Feb 2014 12:19:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751268AbaBDMTC (ORCPT ); Tue, 4 Feb 2014 07:19:02 -0500 Received: from mail03.nap.gsic.titech.ac.jp ([131.112.13.22]:46428 "HELO mail03.nap.gsic.titech.ac.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750937AbaBDMTB (ORCPT ); Tue, 4 Feb 2014 07:19:01 -0500 Received: from 131.112.13.36 by mail03.nap.gsic.titech.ac.jp with Mail2000 ESMTP Server V6.00S(27101:0:AUTH_RELAY) (envelope-from ); Tue, 04 Feb 2014 21:18:56 +0900 (JST) Received: from [131.112.13.20] (mail01.nap.gsic.titech.ac.jp) by drweb1.nap.gsic.titech.ac.jp (Dr.Web MailD 6.0.2.0) with SMTP id 04024785; Tue, 04 Feb 2014 21:18:56 Received: from 131.112.29.201 by mail01.nap.gsic.titech.ac.jp with Mail2000 ESMTP Server V6.00S(18487:1:AUTH_LOGIN) (envelope-from ); Tue, 04 Feb 2014 21:18:51 +0900 (JST) From: Jens Domke To: linux-rdma@vger.kernel.org Cc: Hal Rosenstock Subject: [PATCH 1/1] OpenSM: osm_ucast_dfsssp.c - prevent double free error Date: Tue, 4 Feb 2014 21:18:46 +0900 Message-Id: <1391516326-11399-1-git-send-email-domke.j.aa@m.titech.ac.jp> X-Mailer: git-send-email 1.7.1 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 an error in the routing execution can cause a second free() call on sw_list, which results in a 'double free' error Signed-off-by: Jens Domke --- opensm/osm_ucast_dfsssp.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/opensm/osm_ucast_dfsssp.c b/opensm/osm_ucast_dfsssp.c index 5eaff3d..ec69df0 100644 --- a/opensm/osm_ucast_dfsssp.c +++ b/opensm/osm_ucast_dfsssp.c @@ -2382,6 +2382,7 @@ static int dfsssp_do_dijkstra_routing(void *context) /* the intermediate array lived long enough */ free(sw_list); + sw_list = NULL; /* same is true for the compute node and I/O guid map */ destroy_guid_map(&cn_tbl); cn_nodes_provided = FALSE;