From patchwork Tue Feb 5 17:00:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Netes X-Patchwork-Id: 2098451 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id D376CDF23E for ; Tue, 5 Feb 2013 17:00:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754731Ab3BERAj (ORCPT ); Tue, 5 Feb 2013 12:00:39 -0500 Received: from mail-bk0-f42.google.com ([209.85.214.42]:41740 "EHLO mail-bk0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754447Ab3BERAi (ORCPT ); Tue, 5 Feb 2013 12:00:38 -0500 Received: by mail-bk0-f42.google.com with SMTP id jk7so194238bkc.15 for ; Tue, 05 Feb 2013 09:00:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=4z47VWEy+eY2I7ol5lj3SiuqdnpZ0QzAA6hfPcvBzvw=; b=hoAufW2yRHOomsuqYHJ5GPgKDbogh2Xx67wzvVKzBgnuhAPnS5O5fSX6XO9dpAZpxg MxLMmWo/JLy79hTj72B1GNLADdgbLP+HUEIvqQZZ6h0SURAP7NDKNPNWofhbpDoIhyJF mj2TQQ/gnsjCbCKE4LJ+XnaYGsvKESoyQHKgzb+hLtuPtywS2SqvgvkhlJ5sLMMx2Fq7 vkleBQWLC8auDbBGAoIiX6DCPxICOkEpXHSccK7Tg4kTgdv+qfxja3Bqa14YwnZkj5N/ RZ9LJksbCvYUs6OOmSV8OlDHSrXEAP7KREGQB+kd/a4GVgFtAb+3dcHngBAo/k6tRJz0 pnJw== X-Received: by 10.204.152.138 with SMTP id g10mr6851287bkw.106.1360083637179; Tue, 05 Feb 2013 09:00:37 -0800 (PST) Received: from localhost (out.voltaire.com. [193.47.165.251]) by mx.google.com with ESMTPS id o2sm234081bkv.3.2013.02.05.09.00.35 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 05 Feb 2013 09:00:36 -0800 (PST) From: Alex Netes To: linux-rdma@vger.kernel.org Cc: Hal Rosenstock , Alex Netes Subject: [PATCH 3/6] opensm/osm_sa_informinfo.c: Fix infr_rcv_respond to only copy InformInfo Date: Tue, 5 Feb 2013 19:00:24 +0200 Message-Id: <1360083625-15981-2-git-send-email-alexne@mellanox.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1360083625-15981-1-git-send-email-alexne@mellanox.com> References: <1360083625-15981-1-git-send-email-alexne@mellanox.com> X-Gm-Message-State: ALoCoQkanD95zNatGEbfktEI6NbgBhWMX2KzgpjWY+EVh/xtDCk7m5YUzEF+AhtsPcb2uWug/hfJ Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Hal Rosenstock and not InformInfoRecord which is larger when responding to sets of InformInfo Signed-off-by: Hal Rosenstock Signed-off-by: Alex Netes --- include/opensm/osm_sa.h | 1 + opensm/osm_sa_informinfo.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/opensm/osm_sa.h b/include/opensm/osm_sa.h index 19de2ab..d9016ab 100644 --- a/include/opensm/osm_sa.h +++ b/include/opensm/osm_sa.h @@ -133,6 +133,7 @@ typedef struct osm_sa_item { union { char data[0]; ib_guidinfo_record_t guid_rec; + ib_inform_info_t inform; ib_inform_info_record_t inform_rec; ib_lft_record_t lft_rec; ib_link_record_t link_rec; diff --git a/opensm/osm_sa_informinfo.c b/opensm/osm_sa_informinfo.c index 8f7e5d5..0b3e1f8 100644 --- a/opensm/osm_sa_informinfo.c +++ b/opensm/osm_sa_informinfo.c @@ -64,6 +64,7 @@ #include #define SA_IIR_RESP_SIZE SA_ITEM_RESP_SIZE(inform_rec) +#define SA_II_RESP_SIZE SA_ITEM_RESP_SIZE(inform) typedef struct osm_iir_search_ctxt { const ib_inform_info_record_t *p_rcvd_rec; @@ -213,16 +214,16 @@ static void infr_rcv_respond(IN osm_sa_t * sa, IN osm_madw_t * p_madw) OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "Generating successful InformInfo response\n"); - item = malloc(SA_IIR_RESP_SIZE); + item = malloc(SA_II_RESP_SIZE); if (!item) { OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 4303: " "rec_item alloc failed\n"); goto Exit; } - memcpy(&item->resp.inform_rec, + memcpy(&item->resp.inform, ib_sa_mad_get_payload_ptr(osm_madw_get_sa_mad_ptr(p_madw)), - sizeof(item->resp.inform_rec)); + sizeof(ib_inform_info_t)); cl_qlist_init(&rec_list); cl_qlist_insert_tail(&rec_list, &item->list_item);