Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp189703lqs; Thu, 13 Jun 2024 07:34:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXLyANqrq5Ph4ts5mudpPPAAIXGwC1guWq2U7oUy2S1W0DgPcghSd7agAfwzcTk+iLpEYDotDuRwxqyIavkJpkWK4z+GCkU4pceqlLFiA== X-Google-Smtp-Source: AGHT+IE0Hw0RxXTYFDkPsILaGEtbEkREnsMnWqOikbGB0oLCdcedGUI6zhYP/y/gDwALi3dMFBOb X-Received: by 2002:a50:bb03:0:b0:57c:7119:a9cc with SMTP id 4fb4d7f45d1cf-57cbd690e57mr6989a12.25.1718289292682; Thu, 13 Jun 2024 07:34:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718289292; cv=pass; d=google.com; s=arc-20160816; b=0BxCMlfSxwEQ6k3/tu2x09XOLTU6Q5e/S00HsYhBpCD9LTxzhRyKlga8tdDtqpNzD+ 4+CTf4MhbrLu5H1qLAgg/HDtXnY/LPFQjCe61VakI9v+eRR41F3LS9giybMsxkks8RPc aHfFaxfOv38tTR6WNdjXuvD2H5Qq8OijoguQyUA1721OP295tpWa4+5YNXGXhWl9lpg2 gXGg7zKxs1xaK3ihP0D97ltKtcTvJo2x3SguCw03dVTEnp3gqCnReCtolaOuJHs2AuyN U34Lq+lKfcEGHu9HrfQGIYkSe1Cm6trJT7AcnndeoQG9Ua0uGjyFqj7g82wx5K0cPLY3 gvSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=GUu841f04EncWFMYW6vBBiSV3HmVz/jOjkpdY+qxO/w=; fh=ZadZad7XexKybIAuiA3EQvypXSnW1ZsFdf2GQUUYras=; b=Co4uiuW0uvGNEK28hsZP15CZ78490nNaF9ZcmnVoQkqydaSEhKvpbKWae8g0n+xskz VokHLVm8xwuXUvwUhIekp5F18B/fiVFHRkm+M/vhzzO6foVmEaEvPNTjXoYliLKJAR8S NWMwFodEWG7U3jUrxZMsmGXkSwtDCxZr/pUvMYRZu7DoFZmoFlfKHdhPn/60rjjL7jvU 4bCXm60lfuY+hq3IQc887KV2YFb89Pfhg5f4F+2e0wOW47qZ+Dw2fgTqO9rBvFkj8mEQ FOyGxaRCmvySigSHsqzPnI2WyDn6NsgIVgTsIyWEXZYEj1ecE9dNmSTMXFdkUfFB6aud sjjw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BaSHju8R; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-213429-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213429-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57cb74620cesi785327a12.602.2024.06.13.07.34.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 07:34:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213429-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BaSHju8R; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-213429-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213429-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3E9661F22321 for ; Thu, 13 Jun 2024 14:34:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 57DD9145B12; Thu, 13 Jun 2024 14:34:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BaSHju8R" Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF7A3140391 for ; Thu, 13 Jun 2024 14:34:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718289280; cv=none; b=A/5zqWJMs6gjRkF/KjJxfpnD/YEdHsq5JkraxdZyWbo7cLyC94FBYv9Wbm89nbkFDjyAFrKSZWXNbr0Tlp1AYMkbmPY4syFc5Dck4GJmFrOwGAGBy9m66PF9DOvgXWTjNXmShSP52mbe6R7PcSLYhK/oc0wIxXUZ5LWQGBtV3MU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718289280; c=relaxed/simple; bh=1GvzaJmYhr/v9fiS4GiqGNq8mR0s0kuyVdl55JSOen4=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=oJx8vBUErd9KYxUtYdh9YHqq+DsyS4fhzAnMavOy+BG9h9OogN+6vuz/pZdz096RkLbinr8e8+8oS0JpaesHAleT6UgEhEXdaed4BU370zed9zDA6aywcpqWD/1meOVxiLElog6btfcdejUepq3Y17EQoaAJuAQ+ZmLqFV9molY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=BaSHju8R; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-421757d217aso12696935e9.3 for ; Thu, 13 Jun 2024 07:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718289277; x=1718894077; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=GUu841f04EncWFMYW6vBBiSV3HmVz/jOjkpdY+qxO/w=; b=BaSHju8RJ87dvsBH5YigoNxfASTiHaUAkuOFEXXDiqjbE8vXg7AjidOq0VWTlPfPhC Vz5wbtv9eFd0WoehGQberbdP83nin+vMdgaQqB+rkR7DUT9R8JslsbSi3arwsz+AWj+0 6EgjqeDd0DXr6fKdeUUKaTHG8Ma+rWIzb7fVdxtw99TEps6M/iYq/yCUKn2PsqDke7pK eyL0Sm1yvlIfcqQjIqkYwFDU1wWnpg//+TqSemWQB4AaRWijFW3AHn8iYcLSzaAP8DfX EFm1XNYxMl6IPzu/2VWpE7KJLJ0mA54yb+LGD8fB5XWMBbtj/skYpGu6Iw8cU2BZmQTr Si5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718289277; x=1718894077; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GUu841f04EncWFMYW6vBBiSV3HmVz/jOjkpdY+qxO/w=; b=J86FaxGVrUskQrw8lUWMEXU0DRDTMBsqXi3e9FhF0bN4X6iWc1QlYXABzmto2jIQz/ 9CTvCjGugY0cWP47AGaP94RHTU7GKkKej1SFVV9vegYZ+i/8uERqhw7nBrMApw3MPyk7 GSwquyr6MMyO6AdzFeBIOYFan/Ow+nvgSK1fN9mVfXcwwB1NuATw8uwerKuMZX54Nctx bSXBH2R6J6z2hLincKpKxY4io69kCPWGVO/hvV9aU8J+aL4lTz9pv28DwfakUNNNP6TL VTs7JjN3kdn1rCWiVyPTYRaCDrpWZomn+8VpQUVTl9eUXl1OmTOUn16XuEfJSch90qaO hzGw== X-Forwarded-Encrypted: i=1; AJvYcCWYwUctdRbWrdiOhov+CltgTlBdlFWvVtAiHSK9Gd1CctiveJt0MnO24guvEp2Li7Bpl+GRMFk9gJlNxlC8sXaEwLnWq6yLxAD4syXy X-Gm-Message-State: AOJu0YzcfnyXtEcPrjX2Q3m5JPr7RKYOTjrgdaQeLPIn5S/8Tl9MN0ZG m21yramb+TPOX3XQ0IEISWFL2CLLvQaq4FGeDF74pagzoN42j1AS+vAn8FQUzUs= X-Received: by 2002:a05:600c:42c4:b0:422:6755:17de with SMTP id 5b1f17b1804b1-422867c90f9mr50286365e9.41.1718289277293; Thu, 13 Jun 2024 07:34:37 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42284d1130esm27960335e9.0.2024.06.13.07.34.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 07:34:36 -0700 (PDT) Date: Thu, 13 Jun 2024 17:34:33 +0300 From: Dan Carpenter To: David Hildenbrand Cc: Andrew Morton , Matthew Wilcox , Muhammad Usama Anjum , Andrei Vagin , Ryan Roberts , Hugh Dickins , Kefeng Wang , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] fs/proc/task_mmu: fix uninitialized variable in pagemap_pmd_range() Message-ID: <9d6eaba7-92f8-4a70-8765-38a519680a87@moroto.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding The "folio" pointer is tested for NULL, but it's either valid or uninitialized. Initialize it to NULL. Fixes: 84f57f8b8914 ("fs/proc: move page_mapcount() to fs/proc/internal.h") Signed-off-by: Dan Carpenter --- fs/proc/task_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 631371cb80a0..6ed1f56b32b4 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -1492,7 +1492,7 @@ static int pagemap_pmd_range(pmd_t *pmdp, unsigned long addr, unsigned long end, u64 flags = 0, frame = 0; pmd_t pmd = *pmdp; struct page *page = NULL; - struct folio *folio; + struct folio *folio = NULL; if (vma->vm_flags & VM_SOFTDIRTY) flags |= PM_SOFT_DIRTY; -- 2.43.0