From patchwork Thu Jul 17 18:32:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wan, Kaike" X-Patchwork-Id: 4578141 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 364C9C0514 for ; Thu, 17 Jul 2014 18:33:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6FBF82011B for ; Thu, 17 Jul 2014 18:33:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 58CB620117 for ; Thu, 17 Jul 2014 18:33:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751505AbaGQSdL (ORCPT ); Thu, 17 Jul 2014 14:33:11 -0400 Received: from mga14.intel.com ([192.55.52.115]:62022 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752368AbaGQSdL (ORCPT ); Thu, 17 Jul 2014 14:33:11 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 17 Jul 2014 11:26:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,679,1400050800"; d="scan'208";a="563354103" Received: from phlsvsds.ph.intel.com ([10.228.195.38]) by fmsmga001.fm.intel.com with ESMTP; 17 Jul 2014 11:32:50 -0700 Received: from phlsvsds.ph.intel.com (localhost.localdomain [127.0.0.1]) by phlsvsds.ph.intel.com (8.13.8/8.13.8) with ESMTP id s6HIWoHM031330; Thu, 17 Jul 2014 14:32:50 -0400 Received: (from kaikewan@localhost) by phlsvsds.ph.intel.com (8.13.8/8.13.8/Submit) id s6HIWoX2031327; Thu, 17 Jul 2014 14:32:50 -0400 X-Authentication-Warning: phlsvsds.ph.intel.com: kaikewan set sender to kaike.wan@intel.com using -f From: kaike.wan@intel.com To: sean.hefty@intel.com Cc: linux-rdma@vger.kernel.org, Kaike Wan Subject: [PATCH 1/1] ibacm: Incorrect return value check in path resolution Date: Thu, 17 Jul 2014 14:32:39 -0400 Message-Id: <1405621959-31295-1-git-send-email-kaike.wan@intel.com> 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 X-Spam-Status: No, score=-6.9 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: Kaike Wan The returned variable "addr" should be checked instead of the variable "ep" in the function acm_svr_resolve_path() when query parameters are given in a path record (eg, slid/dlid, sgid/dgid, etc). Signed-off-by: Kaike Wan --- src/acm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/acm.c b/src/acm.c index fae9d0b..11fda4c 100644 --- a/src/acm.c +++ b/src/acm.c @@ -946,7 +946,7 @@ acm_svr_resolve_path(struct acmc_client *client, struct acm_msg *msg) msg->resolve_data[0].info.addr, sizeof *path); acm_log(2, "path %s\n", log_data); addr = acm_get_ep_address(&msg->resolve_data[0]); - if (!ep) { + if (!addr) { acm_log(0, "notice - unknown local end point address\n"); return acmc_resolve_response(client->index, msg, ACM_STATUS_ESRCADDR);