Hi Qiu-ji,
This patch does not look logically correct. if (&evt->node == &phba->ct_ev_waiters) evaluates to true, then it is not possible that (evt->reg_id == event_req->ev_reg_id) is also true.
Because if (evt->reg_id == event_req->ev_reg_id) evaluates to true, it means we have found an lpfc_bsg_event of event_req specified interest and therefore (&evt->node != &phba->ct_ev_waiters) must be true.
Also, following this suggested patch’s logic, if after attempting to go through the phba->ct_ev_waiters list and the evt->node iterator is pointing at exactly the phba->ct_ev_waiters head, then this patch’s kref_put will be for the phba->ct_ev_waiters head which is not a preallocated lpfc_bsg_event object. So, this patch would be calling kref_put on an uninitialized memory region.
Sorry, I cannot acknowledge this patch.
Regards, Justin