From patchwork Mon Mar 7 09:59:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Netes X-Patchwork-Id: 615241 X-Patchwork-Delegate: alexne@voltaire.com 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 p27A3MWJ005731 for ; Mon, 7 Mar 2011 10:03:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754511Ab1CGKDV (ORCPT ); Mon, 7 Mar 2011 05:03:21 -0500 Received: from mail.mellanox.co.il ([194.90.237.43]:40495 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755573Ab1CGKDU (ORCPT ); Mon, 7 Mar 2011 05:03:20 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from alexne@mellanox.com) with SMTP; 7 Mar 2011 12:08:40 +0200 Received: from MTRCASDAG01.mtl.com (172.25.0.174) by MTLCAS02.mtl.com (10.0.8.72) with Microsoft SMTP Server (TLS) id 14.1.270.1; Mon, 7 Mar 2011 11:59:35 +0200 Received: from localhost (172.25.6.157) by MTRCASDAG01.mtl.com (172.25.0.174) with Microsoft SMTP Server (TLS) id 14.1.270.1; Mon, 7 Mar 2011 11:59:35 +0200 Date: Mon, 7 Mar 2011 11:59:30 +0200 From: Alex Netes To: Subject: [PATCH] opensm: Fixed pointer validity check in report_torus_changes() Message-ID: <20110307095930.GH5577@calypso.voltaire.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [172.25.6.157] 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.6 (demeter1.kernel.org [140.211.167.41]); Mon, 07 Mar 2011 10:03:23 +0000 (UTC) diff --git a/opensm/osm_torus.c b/opensm/osm_torus.c index add3cf9..7a2c252 100644 --- a/opensm/osm_torus.c +++ b/opensm/osm_torus.c @@ -7423,13 +7423,17 @@ void report_torus_changes(struct torus *nt, struct torus *ot) { unsigned cnt = 0; unsigned i, j, k; - unsigned x_sz = nt->x_sz; - unsigned y_sz = nt->y_sz; - unsigned z_sz = nt->z_sz; + unsigned x_sz; + unsigned y_sz; + unsigned z_sz; if (!(nt && ot)) return; + x_sz = nt->x_sz; + y_sz = nt->y_sz; + z_sz = nt->z_sz; + if (x_sz != ot->x_sz) { cnt++; OSM_LOG(&nt->osm->log, OSM_LOG_INFO,