Commit 0f0e2159 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by David S. Miller

genetlink: Fix uninitialized variable in genl_validate_assign_mc_groups()

net/netlink/genetlink.c: In function ‘genl_validate_assign_mc_groups’:
net/netlink/genetlink.c:217: warning: ‘err’ may be used uninitialized in this
function

Commit 2a94fe48 ("genetlink: make multicast
groups const, prevent abuse") split genl_register_mc_group() in multiple
functions, but dropped the initialization of err.

Initialize err to zero to fix this.
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a2f4dfba
...@@ -214,7 +214,7 @@ static int genl_validate_assign_mc_groups(struct genl_family *family) ...@@ -214,7 +214,7 @@ static int genl_validate_assign_mc_groups(struct genl_family *family)
{ {
int first_id; int first_id;
int n_groups = family->n_mcgrps; int n_groups = family->n_mcgrps;
int err, i; int err = 0, i;
bool groups_allocated = false; bool groups_allocated = false;
if (!n_groups) if (!n_groups)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment