Re: [PATCH] kalmia: avoid potential uninitialized variable use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Arnd Bergmann <arnd@xxxxxxxx>
Date: Mon, 24 Oct 2016 17:54:18 +0200

> The kalmia_send_init_packet() returns zero or a negative return
> code, but gcc has no way of knowing that there cannot be a
> positive return code, so it determines that copying the ethernet
> address at the end of kalmia_bind() will access uninitialized
> data:
> 
> drivers/net/usb/kalmia.c: In function ʽkalmia_bindʼ:
> arch/x86/include/asm/string_32.h:78:22: error: ʽ*((void *)&ethernet_addr+4)ʼ may be used uninitialized in this function [-Werror=maybe-uninitialized]
>    *((short *)to + 2) = *((short *)from + 2);
>                       ^
> drivers/net/usb/kalmia.c:138:5: note: ʽ*((void *)&ethernet_addr+4)ʼ was declared here
> 
> This warning is harmless, but for consistency, we should make
> the check for the return code match what the driver does everywhere
> else and just progate it, which then gets rid of the warning.
> 
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>

Applied, thanks.
?τθΊ{.nΗ+?·???­?+%?Λ?±ιέΆ??w?Ί{.nΗ+?·??{±ώλώ)ν?ζθw*jg¬±¨Ά????έʼj?Ύ«ώG«?ι?ʼΈʼ·¦j:+v?¨?wθjΨmΆ??ώψ―ω?w?ώ?ΰώf£ʼ·h??β?ϊ??Ω?




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux