]> git.proxmox.com Git - mirror_iproute2.git/commit
devlink: fix uninitialized warning
authorStephen Hemminger <stephen@networkplumber.org>
Sun, 29 Nov 2020 17:31:20 +0000 (09:31 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 30 Nov 2020 00:19:36 +0000 (16:19 -0800)
commitf8176999390f6d9cfbdb838871a318ff91c77702
tree1423271f526a14c72a5a011b79363f79cbc9bf10
parent7a49ff9d7906858ec75b69e9ad05af2bfd9cab4d
devlink: fix uninitialized warning

GCC-10 complains about uninitialized variable.

devlink.c: In function ‘cmd_dev’:
devlink.c:2803:12: warning: ‘val_u32’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 2803 |    val_u16 = val_u32;
      |    ~~~~~~~~^~~~~~~~~
devlink.c:2747:11: note: ‘val_u32’ was declared here
 2747 |  uint32_t val_u32;
      |           ^~~~~~~

This is a false positive because it can't figure out the control flow
when the parse returns error.

Fixes: 2557dca2b028 ("devlink: Add string to uint{8,16,32} conversion for generic parameters")
Cc: shalomt@mellanox.com
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
devlink/devlink.c