From: Joe Eykholt Date: Tue, 25 Aug 2009 21:01:23 +0000 (-0700) Subject: [SCSI] libfc: fix rport event race between READY and LOGO X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=00fea930d404b9a9039291d5a61975e6c2ea974e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [SCSI] libfc: fix rport event race between READY and LOGO When a remote port becomes ready and a LOGO is received before the READY event is in rport_work waiting on the mutex, the event is changed to LOGO and the work queued, so both the calls to rport_work see the LOGO event, and both try to do the list_del(), causing a crash. Don't change the event if it is already set. Signed-off-by: Joe Eykholt Signed-off-by: Robert Love Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c index a1794a39158e..cbf6c9f233ca 100644 --- a/drivers/scsi/libfc/fc_rport.c +++ b/drivers/scsi/libfc/fc_rport.c @@ -1267,9 +1267,7 @@ static void fc_rport_recv_logo_req(struct fc_rport_priv *rdata, return; } - rdata->event = RPORT_EV_LOGO; - fc_rport_state_enter(rdata, RPORT_ST_DELETE); - queue_work(rport_event_queue, &rdata->event_work); + fc_rport_enter_delete(rdata, RPORT_EV_LOGO); lport->tt.seq_els_rsp_send(sp, ELS_LS_ACC, NULL); fc_frame_free(fp);