From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 10C483CC7EB for ; Thu, 21 May 2026 12:01:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779364886; cv=none; b=gHirnHr/9Ti7ebAZ+ougv4M0KGjaryYYoyLuIjVDLZCeXFejl3B+jIP4MmQkM1UCRAD6NtVE3Gd3ZGuAANefJ8MyqqvipaBPqiwLfPCbN7Pane+duzV/js/ap1U/p2jIxeUT5wUahWh+nc6SzcFA/erTKtZ8x/ODW+8BkFyTbMA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779364886; c=relaxed/simple; bh=KXs6qNQwH4DBHRpS7hD+hEdenmQVc94yFGCAPMNNEdQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gu2e04VA8C340aqT4avFM/gMb8vosoB4+qxDnybUhcTXN1RXfaft8CKdNGwfDgeuIZsgEvml9/FQ3VUKdtqqo5RL+Uy62IvrnmG/FfSb0ZnewHpJHtd3GirTyI1ES1lD2KxwQyASdllMHhIU04ci6PfCOfw6yG9vBsBFDI1sZD8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2ba928852a5so41328805ad.1 for ; Thu, 21 May 2026 05:01:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779364884; x=1779969684; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vmzekUUgXNW9PtEwvumFbVkEmkfnVIVC+bSfznNWm+c=; b=VBWse8xl+Wv2EI3ew7o/RqDUnH0No1HaG2EGss0nRubBXdx21f8/24xySpcCvgM63l n1F9fADz8R0iUbYjUFex9atBzadb8j4SA3TM7BttxUeajlrZ50fuDtzYow4JoM0lSEwR owk12XK0s6DFZYuksRbtP0Wy/VgT3MhgrHqx/nqB+ZqQHWAALqRwi8uV2qaic1z428tr tNkQIsybeH1yTtZ6binTtX8bfy2ufPW/PI+Huhkf4SKaxuiJEdhe5SFXwe2+2wBfJZxg mfV3O4Fj9tZGSOTSyL4oMZ5Er6REK3Y+G5Y7l8gUYAGCracE/Uw7mFi1dBTNa8C6FmbG Ur3w== X-Forwarded-Encrypted: i=1; AFNElJ+QSnKwksvonv8Sj8NL01X3c5nyLOOz1oscqGQxZwJPclw3J9mJAgSp3ak26l8YmJyRMmAfvUtCuT8yYDg=@vger.kernel.org X-Gm-Message-State: AOJu0YwCSY0p9/NnUm8TnP8CLV14dgdiUecZcwlFeQ4m1YnN697uDXXH /KOnoMdo4eaJzXBz2Sg4lxyFdJLCa57lguGgkzHDuYV+9AZxYhiRuwGdQOPAXA== X-Gm-Gg: Acq92OGXNM0y/a1ki1x/NhWDYLTYAJCIgQawFCKwDPX+oz8PaLX3XPDtU7MwjeLAEst pHl6r3RgOW/IT6sR7l4EbyKxWsbx6OAxMtGt4Gd/WdW/ep29e9ebYkxj/QCTK64xnIY+SHdnemv oIeI4LnuFQ4V+2XGJU1CijaEYQZ7CSXy+LDxBX0XAsvqFhbgV9rFAKUNlrXaEVppU30jg4QqNhE ypdmu/Daj2KKEjOixQ+enNfTGtzk6hCSrkVD8hQPLosJUB0cB67UjaSUmQvKXMsE6Kd+pDsktiB e1HR4NZPLc54LiEz5ykzx6cSxPxc4bk9afYy4SaEiAeVD20caAdiWJktXidwSkpHCCyxG0K0bFQ Y4MNPdDVgsdsYZt/xc0ETwb4GFqop+KZV7a4u8orvNS2GsoEOJopsoGDBznlRh6KZYeLsny8gAy p2FJPnupRutbP/joCZe0m1L0YbCRstUTYDYs/ennuxWk1ZEsTsfSegpfwDwcykYzkMcXFBzX1gB +scC/YQaOvQSljHCPIla46LCKk0Ui3HPVpxP5M+TF58WNyEWpPWIhoGzctpoiewcDfAABeiRqqG o/J8PmhqVexbZxJhrlHMrVw7bIoyrGs= X-Received: by 2002:a17:902:e5cb:b0:2bd:6cab:85d with SMTP id d9443c01a7336-2bea3091c1dmr27529935ad.3.1779364884180; Thu, 21 May 2026 05:01:24 -0700 (PDT) Received: from localhost (fpd11144dd.ap.nuro.jp. [209.17.68.221]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bea9495041sm9418365ad.35.2026.05.21.05.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2026 05:01:22 -0700 (PDT) Date: Thu, 21 May 2026 21:01:21 +0900 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: Ilpo =?utf-8?B?SsOkcnZpbmVu?= Cc: Gianfranco Dutka , Bjorn Helgaas , linux-pci@vger.kernel.org, LKML Subject: Re: [PATCH] PCI/sysfs: NULL res_attr slot after kfree as defence against double-remove Message-ID: <20260521115906.GC647881@rocinante> References: <20260520211306.3301893-1-gianfranco.dutka@arista.com> <376c679c-8637-d19a-48d1-165d8f2fc2f0@linux.intel.com> 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: <376c679c-8637-d19a-48d1-165d8f2fc2f0@linux.intel.com> > To me it looks more like pci_remove_resource_files() is expected to be > entered only once. > > If this change is accepted, the 2nd entry is "silently" allowed whereas > better course of action would feel to catch that in > pci_remove_resource_files() with: > > if (WARN_ON_ONCE(something)) > return; > > That way, developers may become aware the code has some lifetime issue. > > (I'm not strictly against your change but I think it would be much better > to have sane lifetimes and catch offenders.) The upcoming sysfs changes would remove pci_remove_resource_files() completely, so there would not be anything needed to be done here, hopefully. Thank you! Krzysztof