Commit 5ec11ed2 authored by Mustafa Ismail's avatar Mustafa Ismail Committed by Doug Ledford

i40iw: Do not access pointer after free

Child_listen_node pointer is used in a debug print after kfree.
Move the print before kfree.
Signed-off-by: default avatarMustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: default avatarShiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 342c387b
...@@ -1567,12 +1567,12 @@ static enum i40iw_status_code i40iw_del_multiple_qhash( ...@@ -1567,12 +1567,12 @@ static enum i40iw_status_code i40iw_del_multiple_qhash(
ret = i40iw_manage_qhash(iwdev, cm_info, ret = i40iw_manage_qhash(iwdev, cm_info,
I40IW_QHASH_TYPE_TCP_SYN, I40IW_QHASH_TYPE_TCP_SYN,
I40IW_QHASH_MANAGE_TYPE_DELETE, NULL, false); I40IW_QHASH_MANAGE_TYPE_DELETE, NULL, false);
kfree(child_listen_node);
cm_parent_listen_node->cm_core->stats_listen_nodes_destroyed++;
i40iw_debug(&iwdev->sc_dev, i40iw_debug(&iwdev->sc_dev,
I40IW_DEBUG_CM, I40IW_DEBUG_CM,
"freed pointer = %p\n", "freed pointer = %p\n",
child_listen_node); child_listen_node);
kfree(child_listen_node);
cm_parent_listen_node->cm_core->stats_listen_nodes_destroyed++;
} }
spin_unlock_irqrestore(&iwdev->cm_core.listen_list_lock, flags); spin_unlock_irqrestore(&iwdev->cm_core.listen_list_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment