From patchwork Mon Dec 3 21:24:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 1835411 X-Patchwork-Delegate: alexne@voltaire.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 B4074DF2F9 for ; Mon, 3 Dec 2012 21:24:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752370Ab2LCVYQ (ORCPT ); Mon, 3 Dec 2012 16:24:16 -0500 Received: from mail-bk0-f46.google.com ([209.85.214.46]:60065 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751670Ab2LCVYP (ORCPT ); Mon, 3 Dec 2012 16:24:15 -0500 Received: by mail-bk0-f46.google.com with SMTP id q16so1308849bkw.19 for ; Mon, 03 Dec 2012 13:24:14 -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=H1BirT2HTpyFaWlZBdcAQAPJ7BJrRWkPNRIXsdg3n3ArwEU0iJjjPiVv8p0e5hU3lN 3ouSaEXTjtNyA493JOv3uJif15a+PtM/Q5i31zOID1rhoj6u20+mth2R99PAAVeNuklt sfzJPrT88WiwTraIp/9VCmNjJujzIq6uhxZxTYAUFGroxBT8VDCtkCoYVBW6bFC1+VNt CV8VMEIk0BX2aWlqvqd8YW87egiO8CPK+U0xif0dalQkWxeCZzBtGwpxabybqhADYIEu D2BwZt+2L1SZ58Qfn3/mtP25GChumINsaJoFKiQOLsWxCpbou2dRH8uN1+omgjN2WEWJ CSLQ== Received: by 10.205.129.17 with SMTP id hg17mr3303752bkc.41.1354569854098; Mon, 03 Dec 2012 13:24:14 -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 18sm8521785bkv.0.2012.12.03.13.24.12 (version=SSLv3 cipher=OTHER); Mon, 03 Dec 2012 13:24:13 -0800 (PST) Message-ID: <50BD1879.2080309@dev.mellanox.co.il> Date: Mon, 03 Dec 2012 16:24:09 -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: opensm/osm_torus.c: Fix crash in torus_update_osm_vlarb X-Gm-Message-State: ALoCoQkbQaWKIOBlxCv8BDnpQo0Lm2rTfYTrCs4LY0StEpT2MM9nJPImBdq8dnqPRryXImkuaKX1 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 --- 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;