]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
i40iw: Do not access pointer after free
authorMustafa Ismail <mustafa.ismail@intel.com>
Tue, 12 Jul 2016 16:48:41 +0000 (11:48 -0500)
committerDoug Ledford <dledford@redhat.com>
Tue, 2 Aug 2016 18:17:38 +0000 (14:17 -0400)
Child_listen_node pointer is used in a debug print after kfree.
Move the print before kfree.

Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/i40iw/i40iw_cm.c

index d2fa7251696077a3fb3f7b8cec5955bd9348a603..5026dc79978a7c2ea2a1040861913a3aeaf8d7d9 100644 (file)
@@ -1567,12 +1567,12 @@ static enum i40iw_status_code i40iw_del_multiple_qhash(
                ret = i40iw_manage_qhash(iwdev, cm_info,
                                         I40IW_QHASH_TYPE_TCP_SYN,
                                         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_CM,
                            "freed pointer = %p\n",
                            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);