Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp628979lqs; Fri, 14 Jun 2024 00:08:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXRANRYdduAVN021bF6AyQvVK8ph60JeI3801H+ylXiDH8oo8f9Z4ZMA1GUBbSOOhiwwVnvXvH3l05IizR9n2gXsBzZq5cHwgJ7AazvGA== X-Google-Smtp-Source: AGHT+IHnW5eoywBTywjYL/2aaXRiMQHN3IIRoPo84l2g+AcRk6SyWv1OsqLn1lzfM5WkR12/W2kj X-Received: by 2002:a50:cd5b:0:b0:57a:2ccb:b3f2 with SMTP id 4fb4d7f45d1cf-57cbd6665c9mr1073989a12.16.1718348935517; Fri, 14 Jun 2024 00:08:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718348935; cv=pass; d=google.com; s=arc-20160816; b=dOA638TpXlZgb63UbAjo6vjk4IjByhgGkFN+BRh37hvMYc1TDYpSfgJYNBJe/HGdPG aqy0QVvi+o31jU9bj7iTDoNgWjwgOTEfNWNpdAwxdVl1n4B0UofOcuHC8SjXlBTAesdr CqKV565qVPpOeVX0X3tO71uFqAOMvscvTunr8kwbC9B0CPbN23M75k/OsZDOh74z8laE LOGApuJg4TAKunP2otjiw1ZZTU3tc3PjiKGZLtDrzZ8ByFIsMWRBGsEam3OG21KplGBg bjppg2pJ5jVu+lHjlUDcUa1cHp1/qym15s8r0hcUnuwGf76bOYBRbaMDMQpc5I61uogJ qidg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:cc:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=TOpOWQXYrlaPQVpBq/XHnf0xCfKD+DI1IBQAmYry02k=; fh=yL6J8qB/ua+RZDMQ9nmTePWOx0qsc12kHl/tFcKqHCU=; b=Gsa6tzuqosRK+pJXvzc4QIkiKsDcrI76u12cb5Moue7POV3X7wA1WzZ9LMvc2TODpv YfuLXITnVXIGCYgip7tvjrzcy3Blog646/6+LdM7GZLNxUEnhK1vVkr9K1dMCw0SWvjo g5jOTVQozriDtOpSq8gXoI4ENVQAZr3brVrTjYF67/8De2g3dkdjizXoSgglcSdp9k8p 6DpWPhZMj5bZ8kpsfyfiUQz4rxrQ88tfH71NLKosMJVS/3cRiTclt2Kp/gxPxGgg9kIV ortUT0S6GrUImOwkc/seAFyMvOONCiHJFk+SQWc3GfAXTARtNBT5gbUqx0VGK1i1pinD 20pw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=sVrApOnI; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-214423-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214423-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com 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-57cb742ccafsi1462963a12.306.2024.06.14.00.08.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 00:08:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214423-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=@collabora.com header.s=mail header.b=sVrApOnI; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-214423-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214423-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com 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 3D23F1F22432 for ; Fri, 14 Jun 2024 07:08:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1DD2A148840; Fri, 14 Jun 2024 07:08:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="sVrApOnI" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B71AB17C72; Fri, 14 Jun 2024 07:08:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718348920; cv=none; b=StLPt91NyOjoNBTtvqIIAj4sZlxpkpKJlhxQPJ74R22mDBUQWKFot4oWtSE+RNSyITsKXL6oAPsj7N4gVhSZ75SjlBM9Hl6+1AYN+g3lAmxUh/nj6+VNvShy5BuQbe7DT1mi7ayufSeMuzypI/sieAPMpAP+kk4zhLHZMQT6wpM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718348920; c=relaxed/simple; bh=RHbpY37ublUsDaREUds7wvom8IV9SmFjqR7Mbhiqfy4=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=E+g6LDefD6MnSBL8Ar0z0oZEM/JgLtnkmwP8NTg3u2yoxTeiJyte9/0qev3O6wvPPTHdzw6OLWN/ieg1uDpaoEfMpa3mFwhf2TUEVCsIR1MtuhnctYCHoxdDoz2dwc+9oVXXzsvQtejP9BNmLOpiUTu1g1AFac31yF6X9N0Bl7s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=sVrApOnI; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718348911; bh=RHbpY37ublUsDaREUds7wvom8IV9SmFjqR7Mbhiqfy4=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=sVrApOnINBCRnnn76mp46BkvFXNx4hoPNQthHRDQZt2nhysWrvmkYfMgTQcGFgqQl 0gvsE/09DEQMtLHrg16DCpfyHrjf0Gk4rN2/mYYPewtTLKAGvhatORAgiXMUTI4VgW 0UMwjZDt7fosSxi6fISGaGFBEJs6nXg9efH8ydwf2xRLCFaByScf//Suk/fnh3wgfd MzuaLjA5TRY8eVX8eohB/JYcUnn4VN7ME0wDDKUhVtBzdBKzQOJnMOXMkF2w4tJDes cMRuEKx4VVOkPIo6j58xw1mnYInFv02WzNIlMRALlDnjFvPqDZWSPzoDqmoPUSqfnQ 5AbOUUHQ4ZjBw== Received: from [100.113.15.66] (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 8064737820A7; Fri, 14 Jun 2024 07:08:28 +0000 (UTC) Message-ID: Date: Fri, 14 Jun 2024 12:09:04 +0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: Muhammad Usama Anjum , Andrew Morton , Matthew Wilcox , Andrei Vagin , Ryan Roberts , Hugh Dickins , Kefeng Wang , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] fs/proc/task_mmu: fix uninitialized variable in pagemap_pmd_range() To: Dan Carpenter , David Hildenbrand References: <9d6eaba7-92f8-4a70-8765-38a519680a87@moroto.mountain> Content-Language: en-US From: Muhammad Usama Anjum In-Reply-To: <9d6eaba7-92f8-4a70-8765-38a519680a87@moroto.mountain> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 6/13/24 7:34 PM, Dan Carpenter wrote: > 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; Reviewed-by: Muhammad Usama Anjum -- BR, Muhammad Usama Anjum