linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Denis Pauk <pauk.denis@gmail.com>
Cc: "Bernhard Seibold" <mail@bernhard-seibold.de>,
	"Pär Ekholm" <pehlm@pekholm.org>,
	to.eivind@gmail.com, "Artem S . Tashkinov" <aros@gmx.com>,
	"Vittorio Roberto Alfieri" <me@rebtoor.com>,
	"Sahan Fernando" <sahan.h.fernando@gmail.com>,
	"Andy Shevchenko" <andriy.shevchenko@intel.com>,
	"Jean Delvare" <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 3/3] hwmon: (nct6775) Support access via Asus WMI.
Date: Thu, 16 Sep 2021 06:23:58 -0700	[thread overview]
Message-ID: <522ecf24-8d9c-99d3-828d-069219739bd9@roeck-us.net> (raw)
In-Reply-To: <CAHp75Vfj6yUrYxbCmYuw=poVjY3GmEBrhF2tJHqkKDVtQ4mywA@mail.gmail.com>

On 9/16/21 1:34 AM, Andy Shevchenko wrote:
[ ... ]

>> +       u32 args = bank | (reg << 8) | (val << 16);
>> +       struct acpi_buffer input = { (acpi_size) sizeof(args), &args };
>> +       struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
>> +       acpi_status status;
>> +       union acpi_object *obj;
>> +       u32 tmp = 0;
> 

Ah, you changed the above to add the initialization.
Without knowing that, your comment below is a bit misleading.

Guenter

>> +       obj = output.pointer;
>> +       if (obj && obj->type == ACPI_TYPE_INTEGER)
>> +               tmp = obj->integer.value;
>> +
>> +       if (retval)
>> +               *retval = tmp;
>> +
>> +       kfree(obj);
> 
>> +       if (tmp == ASUSWMI_UNSUPPORTED_METHOD)
> 
> This is uninitialized tmp in case when no obj, or obj is of the wrong type.
> 
>> +               return -ENODEV;
>> +       return 0;
>> +#else
>> +       return -EOPNOTSUPP;
>> +#endif
>> +}
> 

      parent reply	other threads:[~2021-09-16 13:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15 20:42 [PATCH v6 0/3] hwmon: Support access to the NCT677x via Asus WMI Denis Pauk
2021-09-15 20:42 ` [PATCH v6 1/3] hwmon: (nct6775) Use superio_*() function pointers in sio_data Denis Pauk
2021-09-15 20:42 ` [PATCH v6 2/3] hwmon: (nct6775) Use nct6775_*() function pointers in nct6775_data Denis Pauk
2021-09-15 20:42 ` [PATCH v6 3/3] hwmon: (nct6775) Support access via Asus WMI Denis Pauk
2021-09-16  8:34   ` Andy Shevchenko
2021-09-16 13:21     ` Guenter Roeck
2021-09-16 13:23     ` Guenter Roeck [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=522ecf24-8d9c-99d3-828d-069219739bd9@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=aros@gmx.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mail@bernhard-seibold.de \
    --cc=me@rebtoor.com \
    --cc=pauk.denis@gmail.com \
    --cc=pehlm@pekholm.org \
    --cc=sahan.h.fernando@gmail.com \
    --cc=to.eivind@gmail.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;
as well as URLs for NNTP newsgroup(s).