All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] asus-wireless: Toggle airplane mode LED
@ 2017-02-18 20:30 Dan Carpenter
  2017-02-20 14:19 ` João Paulo Rechi Vita
  2017-02-20 19:22 ` João Paulo Rechi Vita
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-02-18 20:30 UTC (permalink / raw)
  To: jprvita; +Cc: platform-driver-x86, acpi4asus-user

Hello João Paulo Rechi Vita,

The patch 2c1a49c96123: "asus-wireless: Toggle airplane mode LED"
from Jun 13, 2016, leads to the following static checker warning:

	drivers/platform/x86/asus-wireless.c:54 asus_wireless_method()
	error: uninitialized symbol 'ret'.

drivers/platform/x86/asus-wireless.c
    33  static u64 asus_wireless_method(acpi_handle handle, const char *method,
    34                                  int param)
    35  {
    36          struct acpi_object_list p;
    37          union acpi_object obj;
    38          acpi_status s;
    39          u64 ret;
    40  
    41          acpi_handle_debug(handle, "Evaluating method %s, parameter %#x\n",
    42                            method, param);
    43          obj.type = ACPI_TYPE_INTEGER;
    44          obj.integer.value = param;
    45          p.count = 1;
    46          p.pointer = &obj;
    47  
    48          s = acpi_evaluate_integer(handle, (acpi_string) method, &p, &ret);

"ret" isn't necessarily initialized on a couple error paths through this
function.

    49          if (ACPI_FAILURE(s))
    50                  acpi_handle_err(handle,
    51                                  "Failed to eval method %s, param %#x (%d)\n",
    52                                  method, param, s);
    53          acpi_handle_debug(handle, "%s returned %#x\n", method, (uint) ret);
    54          return ret;
    55  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [bug report] asus-wireless: Toggle airplane mode LED
  2017-02-18 20:30 [bug report] asus-wireless: Toggle airplane mode LED Dan Carpenter
@ 2017-02-20 14:19 ` João Paulo Rechi Vita
  2017-02-20 19:22 ` João Paulo Rechi Vita
  1 sibling, 0 replies; 4+ messages in thread
From: João Paulo Rechi Vita @ 2017-02-20 14:19 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Platform Driver, acpi4asus-user

On 18 February 2017 at 15:30, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> Hello João Paulo Rechi Vita,
>
> The patch 2c1a49c96123: "asus-wireless: Toggle airplane mode LED"
> from Jun 13, 2016, leads to the following static checker warning:
>
>         drivers/platform/x86/asus-wireless.c:54 asus_wireless_method()
>         error: uninitialized symbol 'ret'.
>
> drivers/platform/x86/asus-wireless.c
>     33  static u64 asus_wireless_method(acpi_handle handle, const char *method,
>     34                                  int param)
>     35  {
>     36          struct acpi_object_list p;
>     37          union acpi_object obj;
>     38          acpi_status s;
>     39          u64 ret;
>     40
>     41          acpi_handle_debug(handle, "Evaluating method %s, parameter %#x\n",
>     42                            method, param);
>     43          obj.type = ACPI_TYPE_INTEGER;
>     44          obj.integer.value = param;
>     45          p.count = 1;
>     46          p.pointer = &obj;
>     47
>     48          s = acpi_evaluate_integer(handle, (acpi_string) method, &p, &ret);
>
> "ret" isn't necessarily initialized on a couple error paths through this
> function.
>

Yes, I have missed that, thanks for catching it! I'll send a fix to this.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [bug report] asus-wireless: Toggle airplane mode LED
  2017-02-18 20:30 [bug report] asus-wireless: Toggle airplane mode LED Dan Carpenter
  2017-02-20 14:19 ` João Paulo Rechi Vita
@ 2017-02-20 19:22 ` João Paulo Rechi Vita
  2017-02-21 13:27   ` Dan Carpenter
  1 sibling, 1 reply; 4+ messages in thread
From: João Paulo Rechi Vita @ 2017-02-20 19:22 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Platform Driver, acpi4asus-user

Hello Dan,

On 18 February 2017 at 15:30, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> Hello João Paulo Rechi Vita,
>
> The patch 2c1a49c96123: "asus-wireless: Toggle airplane mode LED"
> from Jun 13, 2016, leads to the following static checker warning:
>
>         drivers/platform/x86/asus-wireless.c:54 asus_wireless_method()
>         error: uninitialized symbol 'ret'.
>

I believe I have a fix for this, but I'm not able to reproduce this
message with neither of the following:

make C=2 CHECK="/usr/bin/sparse" drivers/platform/x86/asus-wireless.o
make C=2 CHECK="../smatch/smatch -p=kernel" drivers/platform/x86/asus-wireless.o
make C=2 CHECK="scripts/coccicheck" drivers/platform/x86/asus-wireless.o

So I am not able to check the fix. How can I reproduce this?

Thanks,

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [bug report] asus-wireless: Toggle airplane mode LED
  2017-02-20 19:22 ` João Paulo Rechi Vita
@ 2017-02-21 13:27   ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-02-21 13:27 UTC (permalink / raw)
  To: João Paulo Rechi Vita; +Cc: Platform Driver, acpi4asus-user

On Mon, Feb 20, 2017 at 02:22:38PM -0500, João Paulo Rechi Vita wrote:
> Hello Dan,
> 
> On 18 February 2017 at 15:30, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > Hello João Paulo Rechi Vita,
> >
> > The patch 2c1a49c96123: "asus-wireless: Toggle airplane mode LED"
> > from Jun 13, 2016, leads to the following static checker warning:
> >
> >         drivers/platform/x86/asus-wireless.c:54 asus_wireless_method()
> >         error: uninitialized symbol 'ret'.
> >
> 
> I believe I have a fix for this, but I'm not able to reproduce this
> message with neither of the following:
> 
> make C=2 CHECK="/usr/bin/sparse" drivers/platform/x86/asus-wireless.o
> make C=2 CHECK="../smatch/smatch -p=kernel" drivers/platform/x86/asus-wireless.o
> make C=2 CHECK="scripts/coccicheck" drivers/platform/x86/asus-wireless.o
> 
> So I am not able to check the fix. How can I reproduce this?
> 

It's some unpublished Smatch stuff...  I still have too many false
positives.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-21 13:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-18 20:30 [bug report] asus-wireless: Toggle airplane mode LED Dan Carpenter
2017-02-20 14:19 ` João Paulo Rechi Vita
2017-02-20 19:22 ` João Paulo Rechi Vita
2017-02-21 13:27   ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.