From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Colin King <colin.king@canonical.com>
Cc: "Rafael J . Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>,
Maximilian Luz <luzmaximilian@gmail.com>,
Daniel Scally <djrscally@gmail.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][next] ACPI: scan: ensure ret is initialized to avoid garbage being returned
Date: Thu, 10 Jun 2021 15:28:45 +0200 [thread overview]
Message-ID: <CAJZ5v0h962RaReLhKSkOMxb6BT44GAwrFq9qLqChfTH3v__toQ@mail.gmail.com> (raw)
In-Reply-To: <20210609173312.298414-1-colin.king@canonical.com>
On Wed, Jun 9, 2021 at 7:33 PM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> In the unlikely event that there are no callback calls made then ret
> will be returned as an uninitialized value. Clean up static analysis
> warnings by ensuring ret is initialized.
>
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: a9e10e587304 ("ACPI: scan: Extend acpi_walk_dep_device_list()")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/acpi/scan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index c3067e8bfc47..0945d952f0fc 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -2151,7 +2151,7 @@ int acpi_walk_dep_device_list(acpi_handle handle,
> void *data)
> {
> struct acpi_dep_data *dep, *tmp;
> - int ret;
> + int ret = 0;
>
> mutex_lock(&acpi_dep_list_lock);
> list_for_each_entry_safe(dep, tmp, &acpi_dep_list, node) {
> --
Applied with some edits in the subject and changelog.
Basically, if you make changes like this, please specify which piece
of code you change in the subject/changelog.
Thanks!
prev parent reply other threads:[~2021-06-10 13:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-09 17:33 [PATCH][next] ACPI: scan: ensure ret is initialized to avoid garbage being returned Colin King
2021-06-09 21:38 ` Daniel Scally
2021-06-10 6:29 ` Dan Carpenter
2021-06-10 13:28 ` 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=CAJZ5v0h962RaReLhKSkOMxb6BT44GAwrFq9qLqChfTH3v__toQ@mail.gmail.com \
--to=rafael@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=colin.king@canonical.com \
--cc=djrscally@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luzmaximilian@gmail.com \
--cc=rjw@rjwysocki.net \
/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;
as well as URLs for NNTP newsgroup(s).