提交 10499986 编写于 作者: M Mustafa Ismail 提交者: Jason Gunthorpe

i40iw: Do not free sqbuf when event is I40IW_TIMER_TYPE_CLOSE

When the event type is I40IW_TIMER_TYPE_CLOSE, there is no sqbuf and
it should not be freed as one in i40iw_schedule_cm_timer().

Fixes: f27b4746 ("i40iw: add connection management code")
Signed-off-by: NMustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: NShiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
上级 100d6de2
...@@ -1043,7 +1043,7 @@ static int i40iw_parse_mpa(struct i40iw_cm_node *cm_node, u8 *buffer, u32 *type, ...@@ -1043,7 +1043,7 @@ static int i40iw_parse_mpa(struct i40iw_cm_node *cm_node, u8 *buffer, u32 *type,
* i40iw_schedule_cm_timer * i40iw_schedule_cm_timer
* @@cm_node: connection's node * @@cm_node: connection's node
* @sqbuf: buffer to send * @sqbuf: buffer to send
* @type: if it es send ot close * @type: if it is send or close
* @send_retrans: if rexmits to be done * @send_retrans: if rexmits to be done
* @close_when_complete: is cm_node to be removed * @close_when_complete: is cm_node to be removed
* *
...@@ -1067,6 +1067,7 @@ int i40iw_schedule_cm_timer(struct i40iw_cm_node *cm_node, ...@@ -1067,6 +1067,7 @@ int i40iw_schedule_cm_timer(struct i40iw_cm_node *cm_node,
new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC); new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC);
if (!new_send) { if (!new_send) {
if (type != I40IW_TIMER_TYPE_CLOSE)
i40iw_free_sqbuf(vsi, (void *)sqbuf); i40iw_free_sqbuf(vsi, (void *)sqbuf);
return -ENOMEM; return -ENOMEM;
} }
...@@ -1082,7 +1083,6 @@ int i40iw_schedule_cm_timer(struct i40iw_cm_node *cm_node, ...@@ -1082,7 +1083,6 @@ int i40iw_schedule_cm_timer(struct i40iw_cm_node *cm_node,
new_send->timetosend += (HZ / 10); new_send->timetosend += (HZ / 10);
if (cm_node->close_entry) { if (cm_node->close_entry) {
kfree(new_send); kfree(new_send);
i40iw_free_sqbuf(vsi, (void *)sqbuf);
i40iw_pr_err("already close entry\n"); i40iw_pr_err("already close entry\n");
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册