From patchwork Mon Oct 11 11:04:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yevgeny Kliteynik X-Patchwork-Id: 245231 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9BB4iw9012845 for ; Mon, 11 Oct 2010 11:04:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752810Ab0JKLEn (ORCPT ); Mon, 11 Oct 2010 07:04:43 -0400 Received: from mail.mellanox.co.il ([194.90.237.43]:51764 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752487Ab0JKLEm (ORCPT ); Mon, 11 Oct 2010 07:04:42 -0400 Received: from Internal Mail-Server by MTLPINE2 (envelope-from kliteyn@mellanox.co.il) with SMTP; 11 Oct 2010 13:03:36 +0200 Received: from [10.4.1.29] (10.4.1.29) by mtlmail01.mtl.com (10.0.8.12) with Microsoft SMTP Server id 8.2.254.0; Mon, 11 Oct 2010 13:04:37 +0200 Message-ID: <4CB2EF36.2040209@mellanox.co.il> Date: Mon, 11 Oct 2010 13:04:22 +0200 From: Yevgeny Kliteynik Reply-To: kliteyn@dev.mellanox.co.il User-Agent: Thunderbird 1.5.0.5 (X11/20060719) MIME-Version: 1.0 To: Sasha Khapyorsky , Linux RDMA Subject: osm_vl15intf.c: fixing use-after-free coredump Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 11 Oct 2010 11:04:45 +0000 (UTC) diff --git a/opensm/opensm/osm_vl15intf.c b/opensm/opensm/osm_vl15intf.c index bb2c0c6..c845597 100644 --- a/opensm/opensm/osm_vl15intf.c +++ b/opensm/opensm/osm_vl15intf.c @@ -57,13 +57,14 @@ static void vl15_send_mad(osm_vl15_t * p_vl, osm_madw_t * p_madw) { ib_api_status_t status; + boolean_t resp_expected = p_madw->resp_expected; /* Non-response-expected mads are not throttled on the wire since we can have no confirmation that they arrived at their destination. */ - if (p_madw->resp_expected == TRUE) + if (resp_expected) /* Note that other threads may not see the response MAD arrive before send() even returns. @@ -103,7 +104,7 @@ static void vl15_send_mad(osm_vl15_t * p_vl, osm_madw_t * p_madw) qp0_mads_outstanding will be decremented by send error callback (called by osm_vendor_send() */ cl_atomic_dec(&p_vl->p_stats->qp0_mads_sent); - if (!p_madw->resp_expected) + if (!resp_expected) cl_atomic_dec(&p_vl->p_stats->qp0_unicasts_sent); }