Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2401628ybg; Fri, 5 Jun 2020 13:01:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLp27QLSLqO5/rn55vLrLhM06Xwc+y23if/gz8RqQvBVZrt+ePd3B+X6Gh9xwtbKk69p6A X-Received: by 2002:a17:906:46d0:: with SMTP id k16mr10341957ejs.76.1591387296610; Fri, 05 Jun 2020 13:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591387296; cv=none; d=google.com; s=arc-20160816; b=ttVDtvzwRCdOWvrg1/VpNkkNBZCYOS3nqpSdUuTFcWeW5ojEyS3PiWeBAbXFFRSmTf MPCKQcr+l3/oeVDJdFbeyfegz+5pTape7Tf4nvKPnKM0cKdELppTV9Gn9uziocmbUIgl FLyt5q6rAqlzNJCyYiOLk7mPy+BBWvZNQuAEp6p5b2nN81DqUDKEro8++mGd7AwgwRcH Frg+UkAd2F4AKPYB8EBgHTquQnTP1Lj5+Epw+A8RAmSIr8NeD/tX00ZtCaKB5QkOj7q8 CfGZuKaiMe0yL4l8Wm5fZARe+2Yh3IrEHP6ChL+pDF5lLN9R7/qjbcw2eF9l7FbLR0+O /IVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=smVLscndUtcWIRf1BUBIrZ8L43w9eNyfqzYmsNy1U90=; b=YJ9ol6NlAKV4Hh9gsbSjClHQ+wnJro2WYLkmLO+LRHiTWzeM3UL6i3UB7SJrrflopC SKmFtamxzKpQaRb/pjTtmyNbF1cbkvSyI/yjj0+d1NPYqNuuQaYVjDDPkxiVtBn544+e Ue9bvbdbJmgy4LooQwuLje7tbmMwbmKTqeoeEWHQUIyv/hpFBt86qtxnJMhOTVT6kKhX VwRkdULnUw5XpemWt8bWc/QZO7em4901tYjmMtl4vt29WAmgL+ZZcFoTawjR5AT7TJj9 JwNzWRlEYJCphTnvg7YOuKpSvOzQ9RVBVYHxmtZhzREVH7Fn4H/8R+zRwCigFj7CLTtI QuNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tG9yM4X0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a8si4361073ejp.552.2020.06.05.13.01.13; Fri, 05 Jun 2020 13:01:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tG9yM4X0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728163AbgFET5S (ORCPT + 99 others); Fri, 5 Jun 2020 15:57:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727863AbgFET5S (ORCPT ); Fri, 5 Jun 2020 15:57:18 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9796C08C5C2; Fri, 5 Jun 2020 12:57:17 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id 5so3282423pjd.0; Fri, 05 Jun 2020 12:57:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=smVLscndUtcWIRf1BUBIrZ8L43w9eNyfqzYmsNy1U90=; b=tG9yM4X0n4Sj0dzcSzE1E9fhSOml70QBV5f2ujB8mXAoe3tNSs/GA77dwFICRpe7fc 7GudSoCRk+469e/fRE7TK8QKX0EEtdnTcQz7NZUZxPxqfCoHw1uQTAydtdqUTvkINBsv 7GfmCxAKmLx+li3RT29ncAHpPEIkWYC2oAkCGBenxBm6RqdV5p85B1zu2ngB/zNN4KFM SwwFmMsrAYtDvIi1lbv/9GJA0EA50n6OGG92fiw5S0bRvhBURrIyNURmbJ7AIPLnaaA6 MCUXwRnQkG5Umbk923aZjUTq3uD/pe9u0MU/F20cwJ4ge0mqpoxNqhAPU5PrBYM0CjOq i5Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=smVLscndUtcWIRf1BUBIrZ8L43w9eNyfqzYmsNy1U90=; b=b/D8GRDTzsRKhmbjgVNsElpm3Iigh8rK6T3xb8ckPvDF7CYt5hRiJoAz9Ur7P8EGln lHLGPsuVicAlFcnP6QRVLjlNnqSkyP3EfNHyIYaBFV1tzUmHpi5sXF1l4LMQvxW9BDrj M45YhEOrEMSB2wMmHr7qDeJOkphO/6HgrHj2cIsjaa/Mr54f5qTDQg+H/R4T4SHfNSja fDu9HD2K8I3bmj7eICbLoH0qUbgPCGNzsWC0uiERthfpzGnawZM6HLD/7/bTSE++93wF lW4n9AcsXPqdFGcEmXeaBq3Gx3QDDw5N0Bk2NG6POGP2aZhovKFYNnhtbSlVhfaYyzxZ XXWw== X-Gm-Message-State: AOAM533wOhS+JpM7S9GwauxYbVoFaXJgbShnCEzLnpB4LuCLWJBVdLgw FxNZXTWjPLjeqtM8Jk8O/IjXQ7s7 X-Received: by 2002:a17:90a:9d8b:: with SMTP id k11mr4958176pjp.10.1591387037105; Fri, 05 Jun 2020 12:57:17 -0700 (PDT) Received: from [10.1.10.11] (c-73-241-150-58.hsd1.ca.comcast.net. [73.241.150.58]) by smtp.gmail.com with ESMTPSA id x1sm358759pfn.76.2020.06.05.12.57.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Jun 2020 12:57:16 -0700 (PDT) Subject: Re: [PATCH] net/mlx5: Use kfree(ft->g) in arfs_create_groups() To: Denis Efremov , Saeed Mahameed Cc: Leon Romanovsky , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200605192235.79241-1-efremov@linux.com> From: Eric Dumazet Message-ID: <1cd5f60d-4a42-f7ba-1d0b-2303470a1f73@gmail.com> Date: Fri, 5 Jun 2020 12:57:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200605192235.79241-1-efremov@linux.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/5/20 12:22 PM, Denis Efremov wrote: > Use kfree() instead of kvfree() on ft->g in arfs_create_groups() because > the memory is allocated with kcalloc(). > > Signed-off-by: Denis Efremov > --- > drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c > index 014639ea06e3..c4c9d6cda7e6 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c > @@ -220,7 +220,7 @@ static int arfs_create_groups(struct mlx5e_flow_table *ft, > sizeof(*ft->g), GFP_KERNEL); > in = kvzalloc(inlen, GFP_KERNEL); > if (!in || !ft->g) { > - kvfree(ft->g); > + kfree(ft->g); > kvfree(in); > return -ENOMEM; > } > This is slow path, kvfree() is perfectly able to free memory that was kmalloc()ed net-next is closed, can we avoid these patches during merge window ?