Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp606924ybg; Mon, 1 Jun 2020 09:33:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy23nBeTEFkV+3x9b7WSDWpFSD1o+Q5WRkofxTcUSR8F1O2lLShSl+N5m8hgnSD1LFMwGML X-Received: by 2002:a17:906:6a0a:: with SMTP id o10mr19786357ejr.192.1591029195330; Mon, 01 Jun 2020 09:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591029195; cv=none; d=google.com; s=arc-20160816; b=QDvJUzDwljvL+6z6EiWY3Sm5x8nZ+wl1t2bW0Sq1ghQWLWjhHmouDfWLtdsZj2jcLq 5z7IZ/377Hf0aFv9zFAKhvdb/8gMYb96P3300zD088I2VDqo5Dg6C2ZQa7n3gHiVEAqs 85vK6wtZ4hLdNUiocba4nqTk2wNN5UMZLz3ckwpUgBI7FVjS0n8Thbg9zu03aIZQ7onq 7jByMPyNxZU3N5srTZa9ioCQAtjOyrErsL5CpDfKfzLgY3LitBy9YcKlj0fmJrxF6tt3 bZfXHhBY03qPzdxVC1a3FMI1fUpHPbIVkr/ymuXPbYvl+pwFCZjJNz9SVlmQWQY/1AqF 9HAA== 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:mime-version :message-id:date:subject:cc:to:from; bh=wA7BfujTPj1qembVtD2LciwQ5JvA3WupaYltj/e17PM=; b=YRPTdDyoZH6a5hOJj6w8vEEH0LCR/uNQUnrWTR2ZMls3zA19azCyzhl8hxCwOMT0Xa qRlP79oU1ULF8DkCcNQ+RcUtTClPkdVqyu4K3wqFf/y2Zb/0/1Y29iF8FUtpZ8je8FrC 89tXR96r62nO6IUiCvULdWWuakLvCiObJ0NtDy4psuQWYgQtZ30K4JiboSKl+hq/0MVC MHnyJFVmuJaDYH9xPzy4T6T385rHZEPy3i8J2DdqGhfjaCzgP3W1IN476Kl6UiwDVn7J TPskHcBp0F5B89TYy9hSBaTozysqy6FrXXussYj8usvSfOSEEDtxTqEdYDiPQpzxO+iW qRUQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f2si10747962edw.294.2020.06.01.09.32.50; Mon, 01 Jun 2020 09:33:15 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727113AbgFAQ23 (ORCPT + 99 others); Mon, 1 Jun 2020 12:28:29 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:45273 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726067AbgFAQ23 (ORCPT ); Mon, 1 Jun 2020 12:28:29 -0400 Received: by mail-lj1-f196.google.com with SMTP id z18so8844915lji.12; Mon, 01 Jun 2020 09:28:27 -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=wA7BfujTPj1qembVtD2LciwQ5JvA3WupaYltj/e17PM=; b=LefSgdmZ9pcH3ZjUIbneCndRe/HwLDeyUUFO5p68pF606N61Kj6gHx8kDq62IZ0Fg2 YiUwJGS1l/fRHqTzqw2pp8IwsTBQsZVU+tJy9+5AVlOCj0c1BoRhmo5TZsaXMjUDSyOn n3NWFChcQ+gL+gSrIWq2zcv0CAzSXluChT8wVaDubhfYx0ElQW+JwWPFwEdddQ44yVW4 K41IVQVY+/MO0xEOAM9hfyLyirMIcE0VbpTDLK26I4NpQExkHKVsDGPQZ9jTAXstwp+I o8/asxXPOhn4t8nwmpfS+HvKu46wF3rajkLndHZdjgh6eZ4F8O7akOBRT/4wJ9drkqVy DAXg== X-Gm-Message-State: AOAM533egwsOtepingpyn7+U1wosanQSVqbHwv9I14yWlAeBX6S1YVY7 E5idKitZMedvHFFVn4JCsPY= X-Received: by 2002:a2e:9b09:: with SMTP id u9mr2745294lji.207.1591028906891; Mon, 01 Jun 2020 09:28:26 -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 y1sm4595ljh.1.2020.06.01.09.28.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2020 09:28:25 -0700 (PDT) From: Denis Efremov To: Alexei Starovoitov , Martin KaFai Lau Cc: Denis Efremov , bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] bpf: Change kvfree to kfree in generic_map_lookup_batch() Date: Mon, 1 Jun 2020 19:28:14 +0300 Message-Id: <20200601162814.17426-1-efremov@linux.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org buf_prevkey in generic_map_lookup_batch() is allocated with kmalloc(). It's safe to free it with kfree(). Signed-off-by: Denis Efremov --- kernel/bpf/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 4e6dee19a668..10bb622be5b6 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -1383,7 +1383,7 @@ int generic_map_lookup_batch(struct bpf_map *map, buf = kmalloc(map->key_size + value_size, GFP_USER | __GFP_NOWARN); if (!buf) { - kvfree(buf_prevkey); + kfree(buf_prevkey); return -ENOMEM; } -- 2.26.2