From patchwork Mon Dec 3 21:25:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 1835421 X-Patchwork-Delegate: alexne@voltaire.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 88B8640E3F for ; Mon, 3 Dec 2012 21:25:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752425Ab2LCVZe (ORCPT ); Mon, 3 Dec 2012 16:25:34 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:54739 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752407Ab2LCVZe (ORCPT ); Mon, 3 Dec 2012 16:25:34 -0500 Received: by mail-ee0-f46.google.com with SMTP id e53so1868034eek.19 for ; Mon, 03 Dec 2012 13:25:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=hJbZsHmwuwVtISR2KyzXi8oICxauaCfJoKF6PRYu5Ho=; b=UlnGQy1FmVsxy1bvFThrosGbsPorpRivt8wdSTZNuGkfrGx3MBfTANxDFIxApU5qSU 2jWts7gi9e9Gqt8dfTEn8qqA0XgnEGjQ7zR7DzGhX3KIGNUSkwldVuT9F/gpliGmjA7W hBkPpvkx28si/2on57FpWt8sZJfDK1/kkynuGrMGj9MddQv9a4RFlYiKJ3WyHstKYmAV SheFA6SxqClrquC9WjYxMfAO7tlhZRmNKoIlubF2IDxRV5xOi2/fCiadY/ljKx8/59Di pSjKvT7KyAq+yTBWOxGGjijlNjfV8kmXiHEMhnBiwnNchdy+2DW1cRCdaxROPvjQz1RO +pZw== Received: by 10.14.225.4 with SMTP id y4mr10856018eep.6.1354569933063; Mon, 03 Dec 2012 13:25:33 -0800 (PST) Received: from [192.168.1.102] (c-71-192-10-85.hsd1.ma.comcast.net. [71.192.10.85]) by mx.google.com with ESMTPS id b2sm33619350eep.9.2012.12.03.13.25.31 (version=SSLv3 cipher=OTHER); Mon, 03 Dec 2012 13:25:32 -0800 (PST) Message-ID: <50BD18CA.8040409@dev.mellanox.co.il> Date: Mon, 03 Dec 2012 16:25:30 -0500 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Alex Netes CC: "linux-rdma (linux-rdma@vger.kernel.org)" , Jim Schutt Subject: [PATCHv2} opensm/osm_torus.c: Fix crash in torus_update_osm_vlarb X-Gm-Message-State: ALoCoQlNCYI3NalJamW8m1bvVLMr+TYvZo2gCjXTWQK1oD2NeNhLrVNBqNeomhCJR9gjqREOJWQG Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Signed-off-by: Alex Netes Signed-off-by: Hal Rosenstock Acked-by: Jim Schutt --- Change since v1: Fixed NULL pointer check on sw->port[port_num] Pointed out by: Jim Schutt opensm/osm_torus.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/opensm/osm_torus.c b/opensm/osm_torus.c index c06f8d4..075f84a 100644 --- a/opensm/osm_torus.c +++ b/opensm/osm_torus.c @@ -8089,7 +8089,7 @@ void torus_update_osm_vlarb(void *context, osm_physp_t *osm_phys_port, * So, leave VL 0 alone, remap VL 4 to VL 1, zero out the rest, * and compress out the zero entries to the end. */ - if (!sw || !port_num || + if (!sw || !port_num || !sw->port[port_num] || sw->port[port_num]->pgrp->port_grp != 2 * TORUS_MAX_DIM) return;