Skip to content

Commit

Permalink
genetlink: Fix uninitialized variable in genl_validate_assign_mc_grou…
Browse files Browse the repository at this point in the history
…ps()

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 2a94fe4 ("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: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Geert Uytterhoeven authored and David S. Miller committed Nov 28, 2013
1 parent a2f4dfb commit 0f0e215
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netlink/genetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static int genl_validate_assign_mc_groups(struct genl_family *family)
{
int first_id;
int n_groups = family->n_mcgrps;
int err, i;
int err = 0, i;
bool groups_allocated = false;

if (!n_groups)
Expand Down

0 comments on commit 0f0e215

Please sign in to comment.