From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 0B1AC3B2FE4; Fri, 4 Sep 2026 05:08:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788498538; cv=none; b=bDyqhH+y7FipiaJTIdV06d35sZPTH0AhGHtNtv0OrU7GlXJ6A1rUKFAi8cWkgn/aOc3sPOK7jcnIloQ00oxX0lyPaSCk9UHbUrhu96t8ik6U949C9aw2GY8Gm2U4T0BunOfuVJbn5qMtlABwCPrwIfQcyrym/FbKigFym4SUXwk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788498538; c=relaxed/simple; bh=f1hRNbF9n6BgbwU+wVCDSRDDneYZ37t7uskOTryeyi8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ed428l6DmKCNWWaE5abWdeINDKUEITV4B5LqHO6AG+zeqHmhpqGTsWIE2XkaW0QzHFIy28ITDN39crtejTRH30icWgRhZEKIVqpVLUVX4hB8vxaNcWcARh9Yz6p3qLwbCFFHugAgEB6Vhi/OC9dwWwciKykyRc+0CwHfsgPe3mw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AFaP7YC8; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="AFaP7YC8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C3AC1F00A3D; Fri, 4 Sep 2026 05:08:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788498536; bh=zld3+AKtq3Lx4GDK5mSCknTJkp0mWsEqZgdwEqrThJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AFaP7YC8fucxqPiPbxfSb3AtwoelAC0ADxTlmzb/mC3AGAuhQvQHnq93uHACTdXhc VSlVYE14GwPBeyLnVl8QzYc+bh8fscU0PmR4lXTVEqhRLOeUq8gnUJ0YhDT/4nayZp fax/zos8sV03qIV16+OiNzV1yhmf8XceU6tuOHsE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Andy Shevchenko , Bartosz Golaszewski Subject: [PATCH 7.2 098/713] powerpc/powermac: fix OF node refcount Date: Fri, 4 Sep 2026 06:51:06 +0200 Message-ID: <20260904045806.033779369@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260904045803.810145556@linuxfoundation.org> References: <20260904045803.810145556@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bartosz Golaszewski commit bd0abfe6b013aeb2a1aebc5fbc7ceeb50355bda3 upstream. Platform devices created with platform_device_alloc() call platform_device_release() when the last reference to the device's kobject is dropped. This function calls of_node_put() unconditionally. This works fine for devices created with platform_device_register_full() but users of the split approach (platform_device_alloc() + platform_device_add()) must bump the reference of the of_node they assign manually. Add the missing call to of_node_get(). Cc: stable@vger.kernel.org Fixes: 81e5d8646ff6 ("i2c/powermac: Register i2c devices from device-tree") Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski Link: https://patch.msgid.link/20260706-pdev-fwnode-ref-v3-1-1ff028e33779@oss.qualcomm.com Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/platforms/powermac/low_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/powerpc/platforms/powermac/low_i2c.c +++ b/arch/powerpc/platforms/powermac/low_i2c.c @@ -1471,7 +1471,7 @@ static int __init pmac_i2c_create_platfo if (bus->platform_dev == NULL) return -ENOMEM; bus->platform_dev->dev.platform_data = bus; - bus->platform_dev->dev.of_node = bus->busnode; + bus->platform_dev->dev.of_node = of_node_get(bus->busnode); platform_device_add(bus->platform_dev); }