aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/sctp/command.c10
-rw-r--r--net/sctp/sm_statefuns.c8
2 files changed, 4 insertions, 14 deletions
diff --git a/net/sctp/command.c b/net/sctp/command.c
index bb977330002..c0044019db9 100644
--- a/net/sctp/command.c
+++ b/net/sctp/command.c
@@ -52,18 +52,12 @@ int sctp_init_cmd_seq(sctp_cmd_seq_t *seq)
52/* Add a command to a sctp_cmd_seq_t. 52/* Add a command to a sctp_cmd_seq_t.
53 * Return 0 if the command sequence is full. 53 * Return 0 if the command sequence is full.
54 */ 54 */
55int sctp_add_cmd(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj) 55void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj)
56{ 56{
57 if (seq->next_free_slot >= SCTP_MAX_NUM_COMMANDS) 57 BUG_ON(seq->next_free_slot >= SCTP_MAX_NUM_COMMANDS);
58 goto fail;
59 58
60 seq->cmds[seq->next_free_slot].verb = verb; 59 seq->cmds[seq->next_free_slot].verb = verb;
61 seq->cmds[seq->next_free_slot++].obj = obj; 60 seq->cmds[seq->next_free_slot++].obj = obj;
62
63 return 1;
64
65fail:
66 return 0;
67} 61}
68 62
69/* Return the next command structure in a sctp_cmd_seq. 63/* Return the next command structure in a sctp_cmd_seq.
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 6545b5fcbc7..b534dbef864 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -3135,12 +3135,8 @@ sctp_disposition_t sctp_sf_operr_notify(const struct sctp_endpoint *ep,
3135 if (!ev) 3135 if (!ev)
3136 goto nomem; 3136 goto nomem;
3137 3137
3138 if (!sctp_add_cmd(commands, SCTP_CMD_EVENT_ULP, 3138 sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP,
3139 SCTP_ULPEVENT(ev))) { 3139 SCTP_ULPEVENT(ev));
3140 sctp_ulpevent_free(ev);
3141 goto nomem;
3142 }
3143
3144 sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_OPERR, 3140 sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_OPERR,
3145 SCTP_CHUNK(chunk)); 3141 SCTP_CHUNK(chunk));
3146 } 3142 }