Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2919837imm; Sun, 13 May 2018 00:01:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo3sAzPBxPXYGq1pnXXty6W76s4Jf2IKkYJdyUvFMyhWgrBQ29mjUkzwJU8YOFZgVa0V297 X-Received: by 2002:a63:b54b:: with SMTP id u11-v6mr4627501pgo.365.1526194875734; Sun, 13 May 2018 00:01:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526194875; cv=none; d=google.com; s=arc-20160816; b=Bsr/Xmyu5JGqdYnLhLqhtUKhAGr+YY85CtNKOxlO+j1CBn3vvAObSMUizn6fbxXvKD A44GgzSE77p9+h6dxxV1zvwkiUnFSvOv+WO1Bs6qcIvsfl9CcDEkJugMI90QC4ECTI6y rrDlLRXfI71HPPbBMdnHR1xVwlT0aRNNdq4Cvyufdq0bvG6+tTxCyoqTA8oWQqFHc3xF 533lty+W8sBxsiB9pmoXaNWziabyM6WK9VScbK42vgiUMqye5CpkxU7I/AI3b2BMTzMR dwBmM3aKgnMxvCeJ1cn2eDxHXW+Wprw4bGCiiCCGTaI9KCXP9U225V+EzXt+Mdqht3ij tu1Q== 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 :arc-authentication-results; bh=9jmCvalCqCtDca8titjRKV53T9/AfWZR0EBPCjvkfBk=; b=I5nacFj+Z9K9/QLuqgMm10Tu3FYD2TwrwbBT/C7ZdX5QOwe4X/Y3KNX9Wt2PShi/cc 711GYfGVWswts4owMnox2Pk3TBWzxhGsuIHUaCeMorO7dags5IDMBuO6GhJEeKx6VPsd DXBuEy5ccB4SHJJFv77X0+XCGiOSibSE+XjWDwPNY5hC9kKo1eOOfdJIjX4/MOoXWSgr rX9vHPVNEb3UNlCG0lifilDIOFhZS/m6B67RHxKQWQKuTfqEBQ1cXClsUtCfTKJbWwKS WicIKWPEfZdR8PrQeY8Su6H8KZyPn5i1/omjWhvghU8CBRYhcSJNr4zrrrUaCdMw1rTP CWYA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10-v6si5353306pgr.45.2018.05.13.00.01.01; Sun, 13 May 2018 00:01:15 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751338AbeEMHAp (ORCPT + 99 others); Sun, 13 May 2018 03:00:45 -0400 Received: from smtp05.smtpout.orange.fr ([80.12.242.127]:21727 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750910AbeEMHAn (ORCPT ); Sun, 13 May 2018 03:00:43 -0400 Received: from ubuntu-CJ.home ([86.244.116.1]) by mwinf5d09 with ME id lj0W1x00D01t9Ri03j0WBr; Sun, 13 May 2018 09:00:41 +0200 X-ME-Helo: ubuntu-CJ.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 13 May 2018 09:00:41 +0200 X-ME-IP: 86.244.116.1 From: Christophe JAILLET To: saeedm@mellanox.com, matanb@mellanox.com, leon@kernel.org, dledford@redhat.com, jgg@ziepe.ca, davem@davemloft.net Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH v2] {net, IB}/mlx5: Use 'kvfree()' for memory allocated by 'kvzalloc()' Date: Sun, 13 May 2018 09:00:41 +0200 Message-Id: <20180513070041.24246-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When 'kvzalloc()' is used to allocate memory, 'kvfree()' must be used to free it. Signed-off-by: Christophe JAILLET --- v1 -> v2: More places to update have been added to the patch --- drivers/infiniband/hw/mlx5/cq.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/vport.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c index 77d257ec899b..6d52ea03574e 100644 --- a/drivers/infiniband/hw/mlx5/cq.c +++ b/drivers/infiniband/hw/mlx5/cq.c @@ -849,7 +849,7 @@ static int create_cq_user(struct mlx5_ib_dev *dev, struct ib_udata *udata, return 0; err_cqb: - kfree(*cqb); + kvfree(*cqb); err_db: mlx5_ib_db_unmap_user(to_mucontext(context), &cq->db); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index 35e256eb2f6e..b123f8a52ad8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -663,7 +663,7 @@ static int esw_create_vport_rx_group(struct mlx5_eswitch *esw) esw->offloads.vport_rx_group = g; out: - kfree(flow_group_in); + kvfree(flow_group_in); return err; } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/vport.c b/drivers/net/ethernet/mellanox/mlx5/core/vport.c index 177e076b8d17..719cecb182c6 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/vport.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/vport.c @@ -511,7 +511,7 @@ int mlx5_query_nic_vport_system_image_guid(struct mlx5_core_dev *mdev, *system_image_guid = MLX5_GET64(query_nic_vport_context_out, out, nic_vport_context.system_image_guid); - kfree(out); + kvfree(out); return 0; } @@ -531,7 +531,7 @@ int mlx5_query_nic_vport_node_guid(struct mlx5_core_dev *mdev, u64 *node_guid) *node_guid = MLX5_GET64(query_nic_vport_context_out, out, nic_vport_context.node_guid); - kfree(out); + kvfree(out); return 0; } @@ -587,7 +587,7 @@ int mlx5_query_nic_vport_qkey_viol_cntr(struct mlx5_core_dev *mdev, *qkey_viol_cntr = MLX5_GET(query_nic_vport_context_out, out, nic_vport_context.qkey_violation_counter); - kfree(out); + kvfree(out); return 0; } -- 2.17.0