From: Joe Eykholt Date: Tue, 25 Aug 2009 21:02:54 +0000 (-0700) Subject: [SCSI] libfc: don't do discovery before callback is set X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=935d0fce44b906268b8a29de4e72ebb57a3a06d8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [SCSI] libfc: don't do discovery before callback is set It's possible to "restart" discovery before it was started if an RSCN is received early enough. We were jumping to 0 due to the disc_callback function pointer not getting set. Don't restart discovery if disc_callback is NULL. Signed-off-by: Joe Eykholt Signed-off-by: Robert Love Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c index 428421842f3a..1a699f484c85 100644 --- a/drivers/scsi/libfc/fc_disc.c +++ b/drivers/scsi/libfc/fc_disc.c @@ -219,6 +219,9 @@ static void fc_disc_recv_req(struct fc_seq *sp, struct fc_frame *fp, */ static void fc_disc_restart(struct fc_disc *disc) { + if (!disc->disc_callback) + return; + FC_DISC_DBG(disc, "Restarting discovery\n"); disc->requested = 1;