diff options
author | Patrick McHardy <kaber@trash.net> | 2008-05-14 02:25:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-14 02:25:00 -0400 |
commit | c1cc678adaa78ae2aab6a6d699241ad516d84476 (patch) | |
tree | ab2b013c61e94a53413c0a718e847fc06c47a833 /net | |
parent | 5e0f8923f350ff522f8f6aecf198df045af3615f (diff) |
sctp: Fix use of uninitialized pointer
Introduced by c4492586 (sctp: Add address type check while process
paramaters of ASCONF chunk):
net/sctp/sm_make_chunk.c: In function 'sctp_process_asconf':
net/sctp/sm_make_chunk.c:2828: warning: 'addr_param' may be used uninitialized in this function
net/sctp/sm_make_chunk.c:2828: note: 'addr_param' was declared here
Signed-off-by: Patrick McHardy <kaber@trash.net>
Acked-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/sctp/sm_make_chunk.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 6eeee535e94e..bbc7107c86cf 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -2827,6 +2827,9 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc, | |||
2827 | union sctp_addr addr; | 2827 | union sctp_addr addr; |
2828 | union sctp_addr_param *addr_param; | 2828 | union sctp_addr_param *addr_param; |
2829 | 2829 | ||
2830 | addr_param = (union sctp_addr_param *) | ||
2831 | ((void *)asconf_param + sizeof(sctp_addip_param_t)); | ||
2832 | |||
2830 | switch (addr_param->v4.param_hdr.type) { | 2833 | switch (addr_param->v4.param_hdr.type) { |
2831 | case SCTP_PARAM_IPV6_ADDRESS: | 2834 | case SCTP_PARAM_IPV6_ADDRESS: |
2832 | if (!asoc->peer.ipv6_address) | 2835 | if (!asoc->peer.ipv6_address) |
@@ -2840,9 +2843,6 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc, | |||
2840 | return SCTP_ERROR_INV_PARAM; | 2843 | return SCTP_ERROR_INV_PARAM; |
2841 | } | 2844 | } |
2842 | 2845 | ||
2843 | addr_param = (union sctp_addr_param *) | ||
2844 | ((void *)asconf_param + sizeof(sctp_addip_param_t)); | ||
2845 | |||
2846 | af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type)); | 2846 | af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type)); |
2847 | if (unlikely(!af)) | 2847 | if (unlikely(!af)) |
2848 | return SCTP_ERROR_INV_PARAM; | 2848 | return SCTP_ERROR_INV_PARAM; |