lkml.org 
[lkml]   [2021]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v6 3/3] hwmon: (nct6775) Support access via Asus WMI.
From
Date
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
>> +}
>

\
 
 \ /
  Last update: 2021-09-16 15:25    [W:2.414 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site