From patchwork Mon Dec 12 18:20:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13071324 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EB1BC00145 for ; Mon, 12 Dec 2022 18:20:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 46D9F8E0003; Mon, 12 Dec 2022 13:20:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 41D7E8E0002; Mon, 12 Dec 2022 13:20:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E4EF8E0003; Mon, 12 Dec 2022 13:20:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 1A7128E0002 for ; Mon, 12 Dec 2022 13:20:33 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id E061E4023C for ; Mon, 12 Dec 2022 18:20:32 +0000 (UTC) X-FDA: 80234469504.25.F70FDE7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf30.hostedemail.com (Postfix) with ESMTP id 3AD418000F for ; Mon, 12 Dec 2022 18:20:30 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ORjBJehj; spf=pass (imf30.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670869230; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=wKvRIO4qKG6iczskSWCLDSh7tBhagcatV42gi39S0ik=; b=YyaYApseXP1rAxBnicCKShHbVAooIuXkpD0GwJqm1ogFd+Ep6KCG1hpMlH2PE7o2KYhA2C Nn530u6tsY+t3ZRz0ikCeQRcz5PnBTqt2o94LiCNPZz8dSz9YEiHxx/K5PHPFHuW+8NgIm 8mZDQ0oJZuoEvOqgoKFRbgP0G2jvEjg= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ORjBJehj; spf=pass (imf30.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670869230; a=rsa-sha256; cv=none; b=4tiTqYz36g3pMOj9/Z+1sL+5TN25W1dYNTQc6hKsD/UjWik9zDLXbMtuUqtEGoyiyDVh4D KM66XXPY5DjweLDdkeg6Es8H2KbUk4tnglM+vGpJGsila+vfbqJGwB5lFDXwM2VWIgC8ab aU5g3+qz8Rd9cNbV/TeOVOktO/tanP0= 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 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 3AD418000F X-Stat-Signature: cazu3a611picrokgachy34c9ciue8sot X-Rspam-User: X-HE-Tag: 1670869230-70486 X-HE-Meta: U2FsdGVkX1+ulEnl74NBQNllSS3pPLPs9tn3VZPtTZPI8zI5ZEgcmDaTItbBSYmgcQFfAImIfN4ke2Tsd6yyAc/7FGdGk86jVSlofdEKJce/ZwmTYcCoGzvLtJ8T+SipGIaaaZYRHe+5+X+FVl2yTgn8ptAgHV4NFuF2hlYKDeYlC/BX1usfPBNSrLR0P1GgcOnsi+vTDHSjy5U7QE0+I6PcZAAE2IbLOAlt23QScnOXJvfjxTiolRwKUMPMVBaxkm+EpM6TIbGrvCT0/x260ailK+Rk5tPz+ZYYIGyBkUwo4OUctUv/2k5f2zjlKJgZnUdcGAujV5vXguUlQwlhg7oMrXDFpgs1E//2Yi7ltMaoY5zvup2WeYh9D1kMJkjT+4zLUxSE+B/y+tCbZfOBwLDfybX4rXsgSjqJn8OgTwCfFSpyCsM3bNTQApbnefuP8tv3r+DvxXObvlRGmCiOPk55gNdo+5EZYVOvXILz3ufq892CDJJkKrFuv8FG9r32IPFzG0jQHHb2xp0t22ucAN/7P9XyQ5YpzhhXD/eLHS72Awi9fLwN3i8RSXTCFG8xn6ss4dUa5jNzyn/gWPfduU5Pbd4WB4B4kINtcrOc5YlEyVWyefgQv6nYAECUgrtT7FCFxfruVL6T9z77Gie1KbtvVH7QRKEC32VlFiAE3COaVncGCmnBLGJoDQS29o1wSeShigID3f5cM+9o5hxywZDjQeLNcNbLglBWEPrdNrT8qYvVmaRn3WGf6d0pVoKpFZ8jdF1zxtZc5rKo2AeJSCtRTs0IM1Zz+e0KtyvCLrcct4YnCa4OZfy467cDP5gHwz5279N7gVmludzkAbIuVAdpXhzXoTZ4N2b10WQrh3sHRzxSlZovKEfTUPs93jHQ23B7e6SPCDtuUs3rFHC1wuRtHsmASJs6NQvUZagiy+BTfX5qaFf6rcKCVwjd1NxwFnqGa/XGL1TFcs1dCl/ ECQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: We have to free via kvfree(), not via kfree(). Fixes: c77369b437f9 ("mm/gup_test: start/stop/read functionality for PIN LONGTERM 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 = NULL; pin_longterm_test_nr_pages = 0; } @@ -255,7 +255,7 @@ static inline int pin_longterm_test_start(unsigned long arg) fast = !!(args.flags & PIN_LONGTERM_TEST_FLAG_USE_FAST); if (!fast && mmap_read_lock_killable(current->mm)) { - kfree(pages); + kvfree(pages); return -EINTR; }