Skip to content

Commit 3ed7cc0

Browse files
Ingo Molnardavem330
authored andcommitted
dccp: fix warning in net/dccp/options.c
this warning: net/dccp/options.c: In function ‘dccp_parse_options’: net/dccp/options.c:67: warning: ‘value’ may be used uninitialized in this function is a bogus GCC warning. The compiler does not recognize the relation between "value" and "mandatory" variables: the code flow can ever reach the "out_invalid_option:" label if 'mandatory' is set to 1, and when 'mandatory' is non-zero, we'll always have 'value' initialized. Help out the compiler by annotating the variable. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b71e839 commit 3ed7cc0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/dccp/options.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq,
6767
(dh->dccph_doff * 4);
6868
struct dccp_options_received *opt_recv = &dp->dccps_options_received;
6969
unsigned char opt, len;
70-
unsigned char *value;
70+
unsigned char *uninitialized_var(value);
7171
u32 elapsed_time;
7272
__be32 opt_val;
7373
int rc;

0 commit comments

Comments
 (0)