Skip to contentSkip to conversation

Fix Warnings from net/netlink/genetlink.c

PATCH Johannes Berg 2 participants 3 messages Aug 11, 2009 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 4 lines · vibi sreenivasan

Fix following compiler warnings

net/netlink/genetlink.c: In function `genl_register_mc_group':
net/netlink/genetlink.c:139: warning: 'err' might be used uninitialized in this function

Well, only if there's no netns which can't happen.

However, technical problems prohibit your patch from being applied.

a) you sent it to the wrong list, copying netdev

Quoted 1 line

b) this isn't correctly formatted, have you actually read Documentation/SubmittingPatches including the legal text that you're agreeing to (section 12 of that document)?

johannes

Quoted 16 lines
 net/netlink/genetlink.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/netlink/genetlink.c +1 -1
index 575c643..66f6ba0 100644
@@ -136,7 +136,7 @@ int genl_register_mc_group(struct genl_family *family,
 {
 	int id;
 	unsigned long *new_groups;
-	int err;
+	int err = 0;
 
 	BUG_ON(grp->name[0] == '\0');
 
#3 lore raw
In reply to vibi sreenivasan

Hi,

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

net/netlink/genetlink.c: In function `genl_register_mc_group':
net/netlink/genetlink.c:139: warning: 'err' might be used uninitialized in this function

Well, only if there's no netns which can't happen.

So how to silence that warning?

Well, I suppose your patch is the best way anyhow, using uninitialized_var() would seem somewhat dangerous for future modifications of the function.

johannes

#2 lore raw
In reply to Johannes Berg

Hi Johannes,

Quoted 7 lines · Johannes Berg
Quoted 4 lines · vibi sreenivasan

Fix following compiler warnings

net/netlink/genetlink.c: In function `genl_register_mc_group':
net/netlink/genetlink.c:139: warning: 'err' might be used uninitialized in this function

Well, only if there's no netns which can't happen.

So how to silence that warning?

Quoted 5 lines

However, technical problems prohibit your patch from being applied.

a) you sent it to the wrong list, copying netdev

Sorry i will send it to netdev

Quoted 6 lines
Quoted 1 line

b) this isn't correctly formatted, have you actually read Documentation/SubmittingPatches including the legal text that you're agreeing to (section 12 of that document)?

Sorry again i will remove the tags at the end & resubmit it again.

Thanks for pointing out the issues.

Thanks & Regards
vibi sreenivasan

Quoted 19 lines

johannes

Quoted 16 lines
 net/netlink/genetlink.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/netlink/genetlink.c +1 -1
index 575c643..66f6ba0 100644
@@ -136,7 +136,7 @@ int genl_register_mc_group(struct genl_family *family,
 {
 	int id;
 	unsigned long *new_groups;
-	int err;
+	int err = 0;
 
 	BUG_ON(grp->name[0] == '\0');