Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1743750pxp; Thu, 10 Mar 2022 11:13:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZZz4iGmYJTVZqqd2BhyYE+UucgLE/rmpkQvjFQTwROu1OhKfMHvrt2Bj2ScKaTLrRSPqZ X-Received: by 2002:a17:90b:2243:b0:1c3:40b:547 with SMTP id hk3-20020a17090b224300b001c3040b0547mr1226956pjb.69.1646939635341; Thu, 10 Mar 2022 11:13:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646939635; cv=none; d=google.com; s=arc-20160816; b=C084KEawsMOWqOvkYiMFNiuNEWK1sYxEipmd9Fs1+UfyMskhHvxvY6Kc65hTZZrxdS 31zlzuukTrRMMDrBAjJ+r3y0g5O3tpi3/LSb+Su0zBO/ej2b9wS00+yR6W5mNNcTZ0Qk UeZ3Vf+tE5rJi2cQ8wAGvX+gchn7zvT36kYNFYfS5TG5G+BiO4BNgbs8/QSWjfB9reY7 /CZHd3ZBPqyOqQR8DNcbvosYxZrotI2wZE0rl5+gcPbJlEyqTh0suND7uwxWQolrN/21 kK9oFLbvWli7JdPfwDSfMPOiieeukH8BzF/NwVqDrEaeAV4SA7h6Pxbz6fV8p4bYFTC1 i5qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=zHHUBtUPprbsCPGbNB1KEUXaxKSZB0OWdVKt2L61nE0=; b=MEP1CzSfhb+YQIEzFwgGjP+GzXRiogox45NEZXuTgW/Y9ZpkHkSVwfmPeWhJDOiBMI spPzETff7o+ZDfiWhlBqEcHBv5dhsla3PpTE0beXXokgXsOAN//Sx1IL6sQBmI+ToeI4 G/L1dZL3kIf5qnBQqnsoTe7OakDpKWQzQeqSLzZJQERgsFlyllqDnMvCFJoSwyCr9Yav e2CnHOo6+zHAYpr9HnF1RJygS7H4Y6Nq1vNGpqoh91s4i3qy75U8JisIO9Ndl+BAxb4B NxrN4A7IFK6LEZmEso7MWxdTHT+Jh2S1KpfGUMESR5+bCUPVTFnllEBHgGzgb5EUqhGN SsgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gf16-20020a17090ac7d000b001bf8cfc126asi5771293pjb.137.2022.03.10.11.13.38; Thu, 10 Mar 2022 11:13:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240601AbiCJPZL (ORCPT + 99 others); Thu, 10 Mar 2022 10:25:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232317AbiCJPZH (ORCPT ); Thu, 10 Mar 2022 10:25:07 -0500 Received: from www62.your-server.de (www62.your-server.de [213.133.104.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC6BA15722D; Thu, 10 Mar 2022 07:24:03 -0800 (PST) Received: from [78.46.152.42] (helo=sslproxy04.your-server.de) by www62.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1nSKdt-000DUs-L2; Thu, 10 Mar 2022 16:23:53 +0100 Received: from [85.1.206.226] (helo=linux.home) by sslproxy04.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nSKdt-0007vB-6m; Thu, 10 Mar 2022 16:23:53 +0100 Subject: Re: [PATCH] bpf: test_run: use kvfree() for memory allocated with kvmalloc() To: Yihao Han , "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Jesper Dangaard Brouer , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Cc: kernel@vivo.com, toke@redhat.com References: <20220310092828.13405-1-hanyihao@vivo.com> From: Daniel Borkmann Message-ID: Date: Thu, 10 Mar 2022 16:23:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20220310092828.13405-1-hanyihao@vivo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.103.5/26477/Thu Mar 10 10:34:39 2022) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ You have plenty of folks in Cc, just not Toke given b530e9e1063e, so added him. ;) ] On 3/10/22 10:28 AM, Yihao Han wrote: > It is allocated with kvmalloc(), the corresponding release function > should not be kfree(), use vfree() instead. nit: s/vfree/kvfree/ > Generated by: scripts/coccinelle/api/kfree_mismatch.cocci Fixed up typo and added Fixes tag before pushing, thanks! > Signed-off-by: Yihao Han > --- > net/bpf/test_run.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c > index 25169908be4a..b7e1e5f61c50 100644 > --- a/net/bpf/test_run.c > +++ b/net/bpf/test_run.c > @@ -196,9 +196,9 @@ static int xdp_test_run_setup(struct xdp_test_data *xdp, struct xdp_buff *orig_c > err_mmodel: > page_pool_destroy(pp); > err_pp: > - kfree(xdp->skbs); > + kvfree(xdp->skbs); > err_skbs: > - kfree(xdp->frames); > + kvfree(xdp->frames); > return err; > } > >