From patchwork Tue Jan 22 16:39:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Domke X-Patchwork-Id: 2019421 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 BE6253FD1A for ; Tue, 22 Jan 2013 16:47:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753890Ab3AVQry (ORCPT ); Tue, 22 Jan 2013 11:47:54 -0500 Received: from mail03.nap.gsic.titech.ac.jp ([131.112.13.22]:58651 "HELO mail03.nap.gsic.titech.ac.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754767Ab3AVQrx (ORCPT ); Tue, 22 Jan 2013 11:47:53 -0500 Received: from 131.112.13.37 by mail03.nap.gsic.titech.ac.jp with Mail2000 ESMTP Server V6.00S(15878:0:AUTH_RELAY) (envelope-from ); Wed, 23 Jan 2013 01:39:56 +0900 (JST) Received: from [131.112.13.20] (mail01.nap.gsic.titech.ac.jp) by drweb2.nap.gsic.titech.ac.jp (Dr.Web MailD 6.0.2.0) with SMTP id 01618C0D; Wed, 23 Jan 2013 01:39:56 Received: from 131.112.29.201 by mail01.nap.gsic.titech.ac.jp with Mail2000 ESMTP Server V6.00S(792:0:AUTH_LOGIN) (envelope-from ); Wed, 23 Jan 2013 01:39:56 +0900 (JST) From: Jens Domke To: linux-rdma@vger.kernel.org Cc: Alex Netes , Torsten Hoefler , Dan Ben Yosef , Jens Domke Subject: [PATCH 03/10] opensm/osm_ucast_dfsssp.c : fix dereference null return value Date: Wed, 23 Jan 2013 01:39:42 +0900 Message-Id: <1358872782-16912-1-git-send-email-domke.j.aa@m.titech.ac.jp> X-Mailer: git-send-email 1.7.1 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Dan Ben Yosef Dereferencing a null pointer "remote_node" Signed-off-by: Dan Ben Yosef Signed-off-by: Jens Domke --- opensm/osm_ucast_dfsssp.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opensm/osm_ucast_dfsssp.c b/opensm/osm_ucast_dfsssp.c index 013bad4..af1b062 100644 --- a/opensm/osm_ucast_dfsssp.c +++ b/opensm/osm_ucast_dfsssp.c @@ -815,7 +815,7 @@ static int update_channel_dep_graph(cdg_node_t ** cdg_root, osm_node_get_remote_node(local_node, local_port, &remote_port); /* if remote_node is a Hca, then the last channel from switch to Hca would be a sink in the cdg -> skip */ - if (!remote_node->sw) + if (!remote_node || !remote_node->sw) break; remote_lid = cl_ntoh16(osm_node_get_base_lid(remote_node, 0)); @@ -961,7 +961,7 @@ static int remove_path_from_cdg(cdg_node_t ** cdg_root, osm_port_t * src_port, osm_node_get_remote_node(local_node, local_port, &remote_port); /* if remote_node is a Hca, then the last channel from switch to Hca would be a sink in the cdg -> skip */ - if (!remote_node->sw) + if (!remote_node || !remote_node->sw) break; remote_lid = cl_ntoh16(osm_node_get_base_lid(remote_node, 0));