From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
LKML <linux-kernel@vger.kernel.org>,
Linux Memory Management List <linux-mm@kvack.org>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
lkp@lists.01.org, kbuild test robot <lkp@intel.com>,
kernel test robot <oliver.sang@intel.com>
Subject: Re: [PATCH 1/1] ACPI: property: Fix error handling in acpi_init_properties()
Date: Tue, 9 Aug 2022 19:22:02 +0200 [thread overview]
Message-ID: <CAJZ5v0jS9M8N_dHMnL2vW9g844_0Z4crzRdQFOgjcPYu4-7uLw@mail.gmail.com> (raw)
In-Reply-To: <20220808211213.1055148-1-sakari.ailus@linux.intel.com>
On Mon, Aug 8, 2022 at 11:12 PM Sakari Ailus
<sakari.ailus@linux.intel.com> wrote:
>
> buf.pointer, memory for storing _DSD data and nodes, was released if either
> parsing properties or, as recently added, attaching data node tags failed.
> Alas, properties were still left pointing to this memory if parsing
> properties were successful but attaching data node tags failed.
>
> Fix this by separating error handling for the two, and leaving properties
> intact if data nodes cannot be tagged for a reason or another.
>
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Fixes: 1d52f10917a7 ("ACPI: property: Tie data nodes to acpi handles")
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
> Hi Rafael,
>
> This should fix the immediate problem. It needs to be figured out why data
> node tagging doesn't work sometimes but that can wait.
Applied, but ->
> drivers/acpi/property.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> index 9711482014a6..201a5a9b2671 100644
> --- a/drivers/acpi/property.c
> +++ b/drivers/acpi/property.c
> @@ -566,13 +566,13 @@ void acpi_init_properties(struct acpi_device *adev)
> &adev->data, acpi_fwnode_handle(adev)))
> adev->data.pointer = buf.pointer;
>
> - if (!adev->data.pointer ||
> - !acpi_tie_nondev_subnodes(&adev->data)) {
> - acpi_untie_nondev_subnodes(&adev->data);
> + if (!adev->data.pointer) {
> acpi_handle_debug(adev->handle, "Invalid _DSD data, skipping\n");
> ACPI_FREE(buf.pointer);
> + } else {
> + if (!acpi_tie_nondev_subnodes(&adev->data))
> + acpi_untie_nondev_subnodes(&adev->data);
> }
> -
-> dropped this empty line removal which is unrelated to the fix (and
the empty line is there on purpose).
> out:
> if (acpi_of && !adev->flags.of_compatible_ok)
> acpi_handle_info(adev->handle,
> --
Please note that I will not be able to push things after Thursday this
week and throughout the next week, so either this goes in on Thursday
or it will miss 5.20, in which case sorry about that. We'll see.
Thanks!
prev parent reply other threads:[~2022-08-09 17:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-08 21:12 Sakari Ailus
2022-08-09 17:22 ` Rafael J. Wysocki [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJZ5v0jS9M8N_dHMnL2vW9g844_0Z4crzRdQFOgjcPYu4-7uLw@mail.gmail.com \
--to=rafael@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=lkp@lists.01.org \
--cc=oliver.sang@intel.com \
--cc=rafael.j.wysocki@intel.com \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox