From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta1.migadu.com (out-61.mta1.migadu.com [95.215.58.61]) (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 47FCC4B826D for ; Mon, 12 Oct 2026 17:08:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.61 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791824941; cv=none; b=YqCG50z0JGDc3hSGJuDXqNNSqz519ksaLR1JstVT/9ZM7loZuj+juMrA7sAqdKUIAui2NaRvxK+p+5aWDYknNqPmmPo1LdKtfXb+qSneJ/ai3k6kFhV3L8vlQfNi931T7XDVtOfl6zpoU6g7qsiwQ7J6w5IVlKBu+ct1fIEwNXQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791824941; c=relaxed/simple; bh=jL6a5+5jBxh6aj08ydsTft9UH05ysF5Kx7zP21piuQU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VEMxBqo9Pxet93QrhDIlMaa1FXahyctFuLilo83lrhkEnIpXtvZd9MEGJOHH6Cw6AmbztD1QEXwJQlSUhV++N00UaIiY6nCYj5NdbDeKu9HbMavyNVlyOPd6alGei4QkS09M269gbbHxhEnurfHsqFkaWhf0xk6xF6p6Cvkc5dA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=JPOqGB/x; arc=none smtp.client-ip=95.215.58.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="JPOqGB/x" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=jL6a5+5jBxh6aj08ydsTft9UH05ysF5Kx7zP21piuQU=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1791824937; v=1; x=1792429737; b=JPOqGB/xGnPyrn4fZ787j5XNLqdBG/igcKfCNEdBQZ7dozIJp9CCFVe8MSxUfgAEAhBJt2i+ iKjpSFVwqV05rcx5CcumMKexOF9nXCJNbzXH5w+vYtmFYJoVCvGAUa3MvZJde5fGEINiwbvpkr7 CPrfbjn6OAS7FkdjTxtL83Qs= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 0f25970896a4cd0f; Mon, 12 Oct 2026 17:08:56 +0000 X-Mizu-Trace-ID: 0f25970896a4cd0f X-Migadu-Flow: FLOW_OUT Date: Mon, 12 Oct 2026 10:08:55 -0700 From: Shakeel Butt To: Sasha Levin Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , Tejun Heo , Michal =?utf-8?Q?Koutn=C3=BD?= , Shuah Khan , Greg Kroah-Hartman , "T.J. Mercier" , Amir Goldstein , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] selftests: memcg: don't close an uninitialized fd Message-ID: References: <20261011223358.2327625-9-sashal@kernel.org> 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 In-Reply-To: <20261011223358.2327625-9-sashal@kernel.org> On Sun, Oct 11, 2026 at 06:33:37PM -0400, Sasha Levin wrote: > test_memcg_inotify_delete_file() and test_memcg_inotify_delete_dir() > jump to cleanup before the inotify fd is created when cg_name() or > cg_create() fails, and cleanup then closes whatever fd holds: > > test_memcontrol.c:1685:6: warning: variable 'fd' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] > > Initialize fd to -1. > > Fixes: 2de27980e1d46 ("selftests: memcg: Add tests for IN_DELETE_SELF and IN_IGNORED") > Assisted-by: LLM > Signed-off-by: Sasha Levin Acked-by: Shakeel Butt