From patchwork Mon Jun 1 16:45:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Efremov X-Patchwork-Id: 225141 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0127BC433DF for ; Mon, 1 Jun 2020 16:45:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB30720663 for ; Mon, 1 Jun 2020 16:45:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726073AbgFAQpm (ORCPT ); Mon, 1 Jun 2020 12:45:42 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:45496 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726017AbgFAQpm (ORCPT ); Mon, 1 Jun 2020 12:45:42 -0400 Received: by mail-lf1-f66.google.com with SMTP id d7so4289590lfi.12; Mon, 01 Jun 2020 09:45:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=L4x8df+FWwhO9CVIfOrtORCmIfKK22E1tDxPOTpXN5A=; b=jMYlF33eeg9WmJ+6Vi/Uu2VVNPTMBe5oCe/clmgJOkHaGrZwVXhjdb+XBHalXjXqAa hxB9rWx6MqmQHD6oFwFaMVoEhg5+45kVb3aDiFexPgLnB2nNIF2MdsG+CPuBJ4w/PGcc DXH+GzKp9TWm3enMrSDnCvKNrGxWtc/lnLSpZ6r01yRVAx/xvcSZEm+Gq96Cod+Ute3e s2bSUL639xBP0njFEph6bpB8sAgDDKbtYdjQhQlFDqWtCd01P2dL1KLM4RMa1MQg2sho 83GEKkgq8R5/OZSgfDzyBxLvYLb+qDzp0mMAzcGoA1vra7WuXAOSf/EpzCAgcENNze53 qeVg== X-Gm-Message-State: AOAM530femQKKB+0ThsKBHXYVGmWtNxSFOpkssnCyTB8kw3kcmrcLvMB oovJlxfddAXsfv/vCX3kOuY= X-Google-Smtp-Source: ABdhPJze/gK70GwzModVzszP+ciOscUjhqgAb3Eeh1HMv7Nyf+c7n9VafFTWzUM0c3z3gPpxUDmLhQ== X-Received: by 2002:a19:d57:: with SMTP id 84mr11809132lfn.112.1591029939553; Mon, 01 Jun 2020 09:45:39 -0700 (PDT) Received: from localhost.localdomain (broadband-37-110-38-130.ip.moscow.rt.ru. [37.110.38.130]) by smtp.googlemail.com with ESMTPSA id 4sm11062ljq.34.2020.06.01.09.45.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2020 09:45:38 -0700 (PDT) From: Denis Efremov To: "David S. Miller" , Saeed Mahameed , Leon Romanovsky , Alex Vesker Cc: Denis Efremov , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] net/mlx5: DR, Fix freeing in dr_create_rc_qp() Date: Mon, 1 Jun 2020 19:45:26 +0300 Message-Id: <20200601164526.19430-1-efremov@linux.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Variable "in" in dr_create_rc_qp() is allocated with kvzalloc() and should be freed with kvfree(). Fixes: 297cccebdc5a ("net/mlx5: DR, Expose an internal API to issue RDMA operations") Cc: stable@vger.kernel.org Signed-off-by: Denis Efremov --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c index 18719acb7e54..eff8bb64899d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c @@ -181,7 +181,7 @@ static struct mlx5dr_qp *dr_create_rc_qp(struct mlx5_core_dev *mdev, in, pas)); err = mlx5_core_create_qp(mdev, &dr_qp->mqp, in, inlen); - kfree(in); + kvfree(in); if (err) { mlx5_core_warn(mdev, " Can't create QP\n");