Commit dc97a1a9477f969e34b38ca9d9cd231cb93ebea2
1 parent
023e2cfa36
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
genetlink: A genl_bind() to an out-of-range multicast group should not WARN().
Users can request to bind to arbitrary multicast groups, so warning when the requested group number is out of range is not appropriate. And with the warning removed, and the 'err' variable properly given an initial value, we can remove 'found' altogether. Reported-by: Sedat Dilek <sedat.dilek@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 1 additions and 6 deletions Side-by-side Diff
net/netlink/genetlink.c
... | ... | @@ -985,8 +985,7 @@ |
985 | 985 | |
986 | 986 | static int genl_bind(struct net *net, int group) |
987 | 987 | { |
988 | - int i, err; | |
989 | - bool found = false; | |
988 | + int i, err = 0; | |
990 | 989 | |
991 | 990 | down_read(&cb_lock); |
992 | 991 | for (i = 0; i < GENL_FAM_TAB_SIZE; i++) { |
993 | 992 | |
... | ... | @@ -1003,15 +1002,11 @@ |
1003 | 1002 | err = f->mcast_bind(net, fam_grp); |
1004 | 1003 | else |
1005 | 1004 | err = 0; |
1006 | - found = true; | |
1007 | 1005 | break; |
1008 | 1006 | } |
1009 | 1007 | } |
1010 | 1008 | } |
1011 | 1009 | up_read(&cb_lock); |
1012 | - | |
1013 | - if (WARN_ON(!found)) | |
1014 | - err = 0; | |
1015 | 1010 | |
1016 | 1011 | return err; |
1017 | 1012 | } |