During static-analysis of the code, a message appeared stating that
'idby' enum might be used un-initialized.
It described a case in which the 'goto detect' statment occurred and
that means that the enum initialization will be skipped.
Johannes: just move the initialization after the label, instead
of moving the variable as Omer's patch had it since we always
just want it to be II_NONE to start with and don't need it in
any other scope.
Signed-off-by: Omer Dagan <omer.dagan@tandemg.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
err = __handle_cmd(&nlstate, II_WDEV, argc, argv, &cmd);
} else {
int idx;
- enum id_input idby = II_NONE;
+ enum id_input idby;
detect:
+ idby = II_NONE;
if ((idx = if_nametoindex(argv[0])) != 0)
idby = II_NETDEV;
else if ((idx = phy_lookup(argv[0])) >= 0)