Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6352822rwi; Tue, 18 Oct 2022 11:14:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4z1UeKwpKzlyrnnY3gRTv4hYwvZ8NdA0j+dyGfD4qLeYlUVfEpHGd5Px+Wasx6VkKtbqyS X-Received: by 2002:a17:907:70a:b0:741:78ab:dce5 with SMTP id xb10-20020a170907070a00b0074178abdce5mr3530200ejb.527.1666116846310; Tue, 18 Oct 2022 11:14:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666116846; cv=none; d=google.com; s=arc-20160816; b=J6P/3I3ZbSGCaK+RHtUGTzOBfu78n67o1ReYjJmcJrydrdrAvUJOh/VfTnn3+617Vz HVwfY+QqjZKmYWgFmT7m5AhS72DGeiaNIjGWlaGtWfOAN+IRPa0rSjDctZe5YzPQdYUA Cnk5DXqodCKJahpvn6PLu1K/mr1nUEB/autSIPJ3Rc3i76ulHTI7zQgiUFk0zXkkS0zU CsxzgdjAni6Pn+m/PXBAuymNiMhdZHNnF6SV/wbJjEv+PR4Wr8O/hcT35c46d1LXknGn yDj4XM8Yz7UBKQtBejoRAav0r66jMXj11c9oGcAqdF92R0E1+8zgUbFyJC2i/v1l2PXH qCWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=HA5fb2pbkyrxHTn22vsyOQ7wsZ9jvVpC3w69Uu8hBto=; b=rH0TVwzopJJEvbI8C8azcdEp69RWPrz2JsULiAn4/8y+DSt21jqTSqQE+O3S8d7jJy gA6DTT14eV/NoOVadIOFT1loDGTqjmS5M0xr+yBueuVMIYv0RQEZvWvDT/PRCOoOLZkS zpSmsNLjC1Lq6KLq7Qni8h9P31PCaOCrS5pV1ulmYVHXprOOEAjH4nn33QPfH78unhUL QxPG2kkm/P9TGPb/sUI9GsdcgAuqBdP1FbCk78/ir8qYSc6khKqWmaulGQMsysu2fJMA G4aCRc4qKRIMri3LLoXIYFOgnMgRm95/15PqQiPz5Q3vsrvN88/yBn5HQWldZEuorsHB BjHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eb10-20020a0564020d0a00b0044ecd80f257si13271857edb.603.2022.10.18.11.13.39; Tue, 18 Oct 2022 11:14:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229989AbiJRReK (ORCPT + 99 others); Tue, 18 Oct 2022 13:34:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbiJRReI (ORCPT ); Tue, 18 Oct 2022 13:34:08 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FE46B1DF7; Tue, 18 Oct 2022 10:34:06 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.0.0) id b51b4719d7d11cff; Tue, 18 Oct 2022 19:34:04 +0200 Received: from kreacher.localnet (unknown [213.134.183.104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 01841666955; Tue, 18 Oct 2022 19:34:03 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux PCI Cc: Linux ACPI , LKML , Greg Kroah-Hartman , Bjorn Helgaas Subject: [PATCH] ACPI: PCI: Fix device reference counting in acpi_get_pci_dev() Date: Tue, 18 Oct 2022 19:34:03 +0200 Message-ID: <12097002.O9o76ZdvQC@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.183.104 X-CLIENT-HOSTNAME: 213.134.183.104 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrfeelvddgkeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepffffffekgfehheffleetieevfeefvefhleetjedvvdeijeejledvieehueevueffnecukfhppedvudefrddufeegrddukeefrddutdegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudekfedruddtgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohephedprhgtphhtthhopehlihhnuhigqdhptghisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg pdhrtghpthhtohephhgvlhhgrggrsheskhgvrhhnvghlrdhorhhg X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Commit 63f534b8bad9 ("ACPI: PCI: Rework acpi_get_pci_dev()") failed to reference count the device returned by acpi_get_pci_dev() as expected by its callers which in some cases may cause device objects to be dropped prematurely. Add the missing get_device() to acpi_get_pci_dev(). Fixes: 63f534b8bad9 ("ACPI: PCI: Rework acpi_get_pci_dev()") Signed-off-by: Rafael J. Wysocki --- drivers/acpi/pci_root.c | 1 + 1 file changed, 1 insertion(+) Index: linux-pm/drivers/acpi/pci_root.c =================================================================== --- linux-pm.orig/drivers/acpi/pci_root.c +++ linux-pm/drivers/acpi/pci_root.c @@ -323,6 +323,7 @@ struct pci_dev *acpi_get_pci_dev(acpi_ha list_for_each_entry(pn, &adev->physical_node_list, node) { if (dev_is_pci(pn->dev)) { + get_device(pn->dev); pci_dev = to_pci_dev(pn->dev); break; }