From nobody Thu Sep 18 01:08:40 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A56FC4332F for ; Mon, 12 Dec 2022 18:21:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232672AbiLLSVg (ORCPT ); Mon, 12 Dec 2022 13:21:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232759AbiLLSV2 (ORCPT ); Mon, 12 Dec 2022 13:21:28 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70651E31 for ; Mon, 12 Dec 2022 10:20:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670869229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=wKvRIO4qKG6iczskSWCLDSh7tBhagcatV42gi39S0ik=; b=ORjBJehjUqVHN0RVsBfMogCCW7Pcxm2zKVMHPdBgfwOnYCaXCOlTmpD97pxzVdRnqIfdXf jS7e48osNbmPqcVQOeWXUY9bmU3+saWvV+bDD9HRMiDHDY9P5CuRiIreNCgVcEuirZg3IG Yz7SMqcfFZx093G7iWYRd3L+PBK9tqE= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-618-Ftdw1M7zMmqS-nsNq-Icvw-1; Mon, 12 Dec 2022 13:20:23 -0500 X-MC-Unique: Ftdw1M7zMmqS-nsNq-Icvw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 77B1F29324A1; Mon, 12 Dec 2022 18:20:23 +0000 (UTC) Received: from t480s.redhat.com (unknown [10.39.193.144]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC09CC15BAD; Mon, 12 Dec 2022 18:20:21 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , kernel test robot , Julia Lawall , Andrew Morton Subject: [PATCH mm-stable] mm/gup_test: free memory allocated via kvcalloc() using kvfree() Date: Mon, 12 Dec 2022 19:20:18 +0100 Message-Id: <20221212182018.264900-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" We have to free via kvfree(), not via kfree(). Fixes: c77369b437f9 ("mm/gup_test: start/stop/read functionality for PIN LO= NGTERM test") Reported-by: kernel test robot Reported-by: Julia Lawall Cc: Andrew Morton Signed-off-by: David Hildenbrand --- mm/gup_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/gup_test.c b/mm/gup_test.c index 33f431e0da60..8ae7307a1bb6 100644 --- a/mm/gup_test.c +++ b/mm/gup_test.c @@ -214,7 +214,7 @@ static inline void pin_longterm_test_stop(void) if (pin_longterm_test_nr_pages) unpin_user_pages(pin_longterm_test_pages, pin_longterm_test_nr_pages); - kfree(pin_longterm_test_pages); + kvfree(pin_longterm_test_pages); pin_longterm_test_pages =3D NULL; pin_longterm_test_nr_pages =3D 0; } @@ -255,7 +255,7 @@ static inline int pin_longterm_test_start(unsigned long= arg) fast =3D !!(args.flags & PIN_LONGTERM_TEST_FLAG_USE_FAST); =20 if (!fast && mmap_read_lock_killable(current->mm)) { - kfree(pages); + kvfree(pages); return -EINTR; } =20 --=20 2.38.1