From: Geert Uytterhoeven Date: Sat, 23 Nov 2013 12:01:50 +0000 (+0100) Subject: genetlink: Fix uninitialized variable in genl_validate_assign_mc_groups() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0f0e2159c0c101426b705d70f43b9f423d51c869;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 2a94fe48f32ccf7321450a2cc07f2b724a444e5b ("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 Signed-off-by: David S. Miller --- diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 4518a57aa5fe..803206e82450 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c @@ -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)