Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3757280imm; Wed, 5 Sep 2018 05:39:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaIOOp62VovNYsU9kXsnuqen4XT3mAB/Q6AGyI6QuhEiNXygBb0bSoGyCz2l/SZbQl3ph4p X-Received: by 2002:a63:e70e:: with SMTP id b14-v6mr29325305pgi.68.1536151168757; Wed, 05 Sep 2018 05:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536151168; cv=none; d=google.com; s=arc-20160816; b=tP/sXPnhQ+ZhN6DEM5hrt4eA9ETQ5npX4mlMvAMf7fyG1xz0FBX+tneZdOceJn6foS cIlTNMe9xFplbFcijsn6S0yhyI/xqKVl2vTm4+Z5MPJb3lj9bu+n/2zWpKDznPxUcR+R I3lntT5q0J1hT1DCNbOY6rQL2QByjuGBRYbTnyw7zpktLxg5GTO5bu4HkhWJWo9ststu L9kFWomunPK2V+b/mKbL6Br0MQIx2xAFJZNk/1dfvMjkaNaDA3X5bzpbTrclNR5iJTi5 CzUQqoZWpGR+tUa6/rHhMK5Q4YZI9em+gQYSzKxv5CxNzHuGJeISM2KUSeCf+O3H8U+c 3Ecg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=Byc6UTPaFVPrnMU4WYBVXC9kpUBrsysU5M8zZkt0yqU=; b=RQebJAA+aLzOW10fGGEXH+nFVKx+kgvhtEAqnYecncSqeE11zPI1llcO2xXLk7LPsq mIxWc4FKBrMcb9eAYqAdqdh26S/neSnmQ64K1TvmIB+mAodlv1Mqq2RLzz9wxXd+Gkb+ INdrL7U6KnDPcq3W9BQX0DYeeYPta/4dvUj7MxLI/OMHuXRIX5IhOPP653lsJSzgmgeK In9Yal1LO5x2WAvpnW7G2JGqJ1TjEc3LsY+uNvEs/sX5dSULDqJL6+NbcgbC3mhKPsSv FdMh2/xubdHemnq8fKDAMbRHUyWJHUKxNS8J7qpKi+4ziGLh+rNyZ0pSe9ocXinxZ2gh o3jw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6-v6si1733173pgq.240.2018.09.05.05.39.13; Wed, 05 Sep 2018 05:39:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728200AbeIERHy (ORCPT + 99 others); Wed, 5 Sep 2018 13:07:54 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55698 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728047AbeIERHy (ORCPT ); Wed, 5 Sep 2018 13:07:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E49C740216E5; Wed, 5 Sep 2018 12:37:48 +0000 (UTC) Received: from hive.brq.redhat.com (unknown [10.43.2.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 86EF7B27BF; Wed, 5 Sep 2018 12:37:47 +0000 (UTC) From: Petr Oros To: netdev@vger.kernel.org Cc: ivecera@redhat.com, Sathya Perla , Ajit Khaparde , Sriharsha Basavapatna , Somnath Kotur , "David S. Miller" , linux-kernel@vger.kernel.org Subject: [PATCH net] be2net: Fix memory leak in be_cmd_get_profile_config() Date: Wed, 5 Sep 2018 14:37:45 +0200 Message-Id: <20180905123746.7399-1-poros@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 05 Sep 2018 12:37:48 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 05 Sep 2018 12:37:48 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'poros@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DMA allocated memory is lost in be_cmd_get_profile_config() when we call it with non-NULL port_res parameter. Signed-off-by: Petr Oros --- drivers/net/ethernet/emulex/benet/be_cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index ff92ab1daeb8..1e9d882c04ef 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c @@ -4500,7 +4500,7 @@ int be_cmd_get_profile_config(struct be_adapter *adapter, port_res->max_vfs += le16_to_cpu(pcie->num_vfs); } } - return status; + goto err; } pcie = be_get_pcie_desc(resp->func_param, desc_count, -- 2.16.4