diff options
author | Dan Carpenter <error27@gmail.com> | 2010-04-30 22:41:09 -0400 |
---|---|---|
committer | Vlad Yasevich <vladislav.yasevich@hp.com> | 2010-04-30 22:41:09 -0400 |
commit | b99a4d53a74ac25eb4b930eef6c745579149c571 (patch) | |
tree | fec5c6fa1d9fa083d9676417f3c1e4edf8ce1094 | |
parent | 787a51a0878f7bee3a9a83040077301e1556b69a (diff) |
sctp: cleanup: remove duplicate assignment
This assignment isn't needed because we did it earlier already.
Also another reason to delete the assignment is because it triggers a
Smatch warning about checking for NULL pointers after a dereference.
Reported-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
-rw-r--r-- | net/sctp/sm_make_chunk.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 17cb400ecd6a..33aed1c6cbd6 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -419,10 +419,17 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, | |||
419 | if (!retval) | 419 | if (!retval) |
420 | goto nomem_chunk; | 420 | goto nomem_chunk; |
421 | 421 | ||
422 | /* Per the advice in RFC 2960 6.4, send this reply to | 422 | /* RFC 2960 6.4 Multi-homed SCTP Endpoints |
423 | * the source of the INIT packet. | 423 | * |
424 | * An endpoint SHOULD transmit reply chunks (e.g., SACK, | ||
425 | * HEARTBEAT ACK, * etc.) to the same destination transport | ||
426 | * address from which it received the DATA or control chunk | ||
427 | * to which it is replying. | ||
428 | * | ||
429 | * [INIT ACK back to where the INIT came from.] | ||
424 | */ | 430 | */ |
425 | retval->transport = chunk->transport; | 431 | retval->transport = chunk->transport; |
432 | |||
426 | retval->subh.init_hdr = | 433 | retval->subh.init_hdr = |
427 | sctp_addto_chunk(retval, sizeof(initack), &initack); | 434 | sctp_addto_chunk(retval, sizeof(initack), &initack); |
428 | retval->param_hdr.v = sctp_addto_chunk(retval, addrs_len, addrs.v); | 435 | retval->param_hdr.v = sctp_addto_chunk(retval, addrs_len, addrs.v); |
@@ -461,18 +468,6 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, | |||
461 | /* We need to remove the const qualifier at this point. */ | 468 | /* We need to remove the const qualifier at this point. */ |
462 | retval->asoc = (struct sctp_association *) asoc; | 469 | retval->asoc = (struct sctp_association *) asoc; |
463 | 470 | ||
464 | /* RFC 2960 6.4 Multi-homed SCTP Endpoints | ||
465 | * | ||
466 | * An endpoint SHOULD transmit reply chunks (e.g., SACK, | ||
467 | * HEARTBEAT ACK, * etc.) to the same destination transport | ||
468 | * address from which it received the DATA or control chunk | ||
469 | * to which it is replying. | ||
470 | * | ||
471 | * [INIT ACK back to where the INIT came from.] | ||
472 | */ | ||
473 | if (chunk) | ||
474 | retval->transport = chunk->transport; | ||
475 | |||
476 | nomem_chunk: | 471 | nomem_chunk: |
477 | kfree(cookie); | 472 | kfree(cookie); |
478 | nomem_cookie: | 473 | nomem_cookie: |