Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1510631 > unrolled thread

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

Started byDavid Miller <davem@davemloft.net>
First post2016-10-27 22:30 +0200
Last post2016-10-27 22:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] kalmia: avoid potential uninitialized variable use David Miller <davem@davemloft.net> - 2016-10-27 22:30 +0200

#1510631 — Re: [PATCH] kalmia: avoid potential uninitialized variable use

FromDavid Miller <davem@davemloft.net>
Date2016-10-27 22:30 +0200
SubjectRe: [PATCH] kalmia: avoid potential uninitialized variable use
Message-ID<swZtf-6Gr-11@gated-at.bofh.it>
From: Arnd Bergmann <arnd@arndb.de>
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@arndb.de>

Applied, thanks.

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web