From patchwork Tue Jun 11 18:24:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2705451 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CA6EA9F4B4 for ; Tue, 11 Jun 2013 18:24:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 984F020472 for ; Tue, 11 Jun 2013 18:24:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2BED920471 for ; Tue, 11 Jun 2013 18:24:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755957Ab3FKSYd (ORCPT ); Tue, 11 Jun 2013 14:24:33 -0400 Received: from mail-ee0-f43.google.com ([74.125.83.43]:60773 "EHLO mail-ee0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756010Ab3FKSYd (ORCPT ); Tue, 11 Jun 2013 14:24:33 -0400 Received: by mail-ee0-f43.google.com with SMTP id l10so3267965eei.30 for ; Tue, 11 Jun 2013 11:24:31 -0700 (PDT) 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=QF6DUnXzSA84aKafSvt0vV/L+oN+CgJJdu25cefAOco=; b=gkFlXiy7hfV1NRhCr6Wu/gIZAAPAFkbARTtBYOVJblhC05O3//ZmoBLWrkCfpWmZ9H OOlaEpzU+S+UJLEynI5qgeP0gFzHkiBKKEY0w7e162HeF+3JeQTg+Gmhs8plqjV619ra VvdRkCnKFbGNTjxTcP7jPTjaNf85Pgfxdmg3vudX1h09CQ7fsbPPys1Fvv4okYa5E10k +Y1eNGQK1TPRbVPqBj5mGFPjlvNPAS6WnxLm1FDTnGNNJVrX6jEGyyvuBbfrPfvC24MN iu67j9cEoc2Xjov1fGs7CZTs0dvype7YS/wIo9Nbc51Rya2bGPEWYVESdrl/UNFYDudk GjFg== X-Received: by 10.14.111.7 with SMTP id v7mr11739073eeg.84.1370975071525; Tue, 11 Jun 2013 11:24:31 -0700 (PDT) Received: from [192.168.1.102] (c-71-234-225-85.hsd1.ct.comcast.net. [71.234.225.85]) by mx.google.com with ESMTPSA id p43sm31992727eem.11.2013.06.11.11.24.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Jun 2013 11:24:31 -0700 (PDT) Message-ID: <51B76B5C.3070108@dev.mellanox.co.il> Date: Tue, 11 Jun 2013 14:24:28 -0400 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: "linux-rdma (linux-rdma@vger.kernel.org)" CC: Dan Ben-Yosef Subject: [PATCH] osm_ucast_cache.c : Fix dereference null return value X-Gm-Message-State: ALoCoQn6laKdvWC78CTAy+orweiYbaAwgfq/md5eBQHQbQ32Yc96cOPZLP1zGDtxhWGzUZ5zTnbD Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From c5ef3da14a22721a09edc5a0d70ca1715b310c6f Mon Sep 17 00:00:00 2001 From: Dan Ben Yosef Date: Tue, 4 Dec 2012 16:44:06 +0200 Subject: [PATCH] osm_ucast_cache.c : Fix dereference null return value Dereferencing a null pointer "p_remote_port". Signed-off-by: Dan Ben Yosef --- opensm/osm_ucast_cache.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/opensm/osm_ucast_cache.c b/opensm/osm_ucast_cache.c index 952622f..78e40f3 100644 --- a/opensm/osm_ucast_cache.c +++ b/opensm/osm_ucast_cache.c @@ -559,6 +559,17 @@ static void ucast_cache_validate(osm_ucast_mgr_t * p_mgr) osm_get_port_by_guid(p_mgr->p_subn, osm_physp_get_port_guid (p_remote_physp)); + if (!p_remote_port) { + OSM_LOG(p_mgr->p_log, + OSM_LOG_ERROR, + "ERR AD04: No port was found for " + "port GUID 0x%" PRIx64 "\n", + cl_ntoh64(osm_physp_get_port_guid + (p_remote_physp))); + osm_ucast_cache_invalidate + (p_mgr); + goto Exit; + } if (p_remote_port->is_new) { OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,