From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 25FEB3D16EC for ; Tue, 5 May 2026 10:36:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777977401; cv=none; b=TKb+Bdbugl5O1nFrwLoSA/HHBwyO5ppcYtVHKjNGefSoG73j6YaIPviC+lwizts/RCyXOtUm4+w8N2WrF4eyQtWwHi6wVMgE0vvgMx6uXyHhWN7xe3sr7j9iMKskBQ7Y2Ag1ra9Ol7QDcupRqLAMU/ImahTuQ8dNsV8lttBosr8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777977401; c=relaxed/simple; bh=YYe0UsBMCaRl/SSTsNMvYXizf5N50Ge9yNyjOI2yeog=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=D5wpcaM0Er7pDHbb/5y/qHZqkX4nzSYaQVX1SSCyP4GkVjAi5xJ1fn5eHT0OKyLjppZCJE1HAxmsdXnk3sNTIC4K2W9yVZ00WLkxQx97pA3f4jMMWDHd7nhXtu6qDjdWU1I47TWlXu5D7ck/lqiCY7KmRNXPmyEYEMfsGWJXW/Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PKzshV6e; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PKzshV6e" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-5a2c3dfb4a1so4816094e87.2 for ; Tue, 05 May 2026 03:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777977398; x=1778582198; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YYe0UsBMCaRl/SSTsNMvYXizf5N50Ge9yNyjOI2yeog=; b=PKzshV6eK7GAfq3w57/u28D4PzUHGvxTno8gP6wmJZOGd/Z/31AbLENYaP072OynLm dCYzRAyJl0LdGqZqTP5jRAee8eKNuqr4wv72TquIX6aYuYwQ4VD8wvu2MQCTUNJt1/3u AgYj3C/nXBBMqCUmM1+Cwn58+dZfJq37d0WYnmlOaQT4psUjCZzYT8ZI/tDp6rpY3wuF B9HbJMTR8HIW7TwP3rNF/80J6B5g5ufBg03cmWdj6+er/D+3NhFptUH6WaG6cdv60B/2 OPA1V+JMfbbxa5Cn/zNwEkvGHcev4MXpB//ZGBeHZSHNmNBnPg/uQWE5N/GlSVUyKSjD qpfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777977398; x=1778582198; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=YYe0UsBMCaRl/SSTsNMvYXizf5N50Ge9yNyjOI2yeog=; b=Abe15puWPpSaosC+GejriCDITDWh05pqpHvUE4AWiWRjTN/hMJ95WXCp8vo/Z44BDo V0AHD7PfqvYftj3RpyFLHmynJkGNY6/YuEoN6RdQ5i4KaKzh8WQ7uNElLSYXEWQBS9wf sDrksIUHn04duqy0OnzjdGDdgS1gU1NzCcO4EdNQwKo07WWuitCFITx6fU8J/AnNb997 RuWl5dpW0RfYkeARYHqwM9Fn9J5hN8ndV+5IONbnL9tqVGoRx9psk1/VMr1b5NIjuThk NBudhVPFrEzJ/AEde1yKHR+KxG65yP0ZP7HO2AJHSd305+Q0tzsJHR+KK+ydc/tN9ITD sFAA== X-Forwarded-Encrypted: i=1; AFNElJ8Qc4G21wz/cIGTEn5LV8sa1U46Qrn7sBLDvxui/A187r2ziQrqdS+Gzu0QgHBl1htmwFSJUjQ4YAK4IGc=@vger.kernel.org X-Gm-Message-State: AOJu0YxSrjjOFlAc3jH+AJPlrN+ZyBqP7A+cMimzOKwBlWVN4wrQbcyX gQqj1ed6c+DQVNPMi/7lCWO14UArXEygAWjq7GSKT0SkqrO98RRujtvz X-Gm-Gg: AeBDietd62bhk00p9bhBAr3CTCOu3qQEaLJ8yYuFWPubd0TFH9pq6ill3VcLceUq0OX OL4lDE9JR4kq2ZF+ra5tTA8xcbWw9Lo9PDb3lnXRzBM/NSbImmvIPhF11V9qi3wpTIYqrQNk1DD XjiIYu1UPz6kuMT7h2eCShUQMvkEivTZqvMkExZu4iwOhErENe3U/3qdrzJCi5yJ76WKv4kOCDB 5pxXBWrBp+G3GnSSQMpPoXEyBCaiDRl4kMNYWCdaDpdB4sNAPCyDo/nPdQywvjN/V/XUlOVsizk VJgIohw1mv3i38oaEDFKyq99i+Hu8TbH8dyfF25QurXUTibpY/Xr2vtse5jiTyYRnUdYri+NTnp OEfboMPAuE4LanslW/o3lguFJfBQEi/2p9Wpa+W2ZYWXjapkwj1z0GT/PO0O1zDb2fUOxO8YWnq Cl7EPuvd7evwrZohWB6Oi0j5/SOW2PT7hYNoIkUn6iLfuc+6edEY/FU6gY7b9vCaAt0XwYmGI= X-Received: by 2002:a05:6512:800e:20b0:5a8:6391:4fe5 with SMTP id 2adb3069b0e04-5a863915030mr3062779e87.26.1777977397888; Tue, 05 May 2026 03:36:37 -0700 (PDT) Received: from va-HP-Pavilion-Desktop-595-p0xxx.mshome.net ([193.0.150.248]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a85c341848sm3774443e87.65.2026.05.05.03.36.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 03:36:37 -0700 (PDT) From: Valery Borovsky To: Will Deacon Cc: Mark Rutland , Arnd Bergmann , Greg Kroah-Hartman , Benson Leung , Tzung-Bi Shih , Guenter Roeck , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Andy Shevchenko , Linus Walleij , Randy Dunlap , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev, linux-mtd@lists.infradead.org, Valery Borovsky Subject: Re: [PATCH 1/5] perf/arm_pmu_acpi: fix reference leak in arm_pmu_acpi_probe error path Date: Tue, 5 May 2026 13:36:27 +0300 Message-ID: X-Mailer: git-send-email 2.51.0 In-Reply-To: References: 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=UTF-8 Content-Transfer-Encoding: 8bit Yeah, you're right, my bad. The `arm_pmu_acpi.c` patch is definitely broken. Since `spe_dev` and `trbe_dev` are statically allocated, they don't have a `.dev.release` callback. If we hit `platform_device_put()` here, the refcount drops to zero and triggers `device_release()`, which is going to scream about the missing release function. At best, we get a messy WARN; at worst, it'll panic the kernel if someone's running with `panic_on_warn`. The kernel-doc note about `platform_device_put()` is really meant for dynamic allocations where the release path actually frees memory. For static setups like this, the original code is actually the right way to go. Please drop patches 1/5 through 4/5 from the v1 series—they all suffer from the same logic error. Patch 5/5 (mfd: sm501) is the only clean one, so I've re-sent that as a standalone v2. Sorry for the noise. Valery Borovsky