]> Pileus Git - ~andy/linux/commitdiff
[SCSI] libfc: don't do discovery before callback is set
authorJoe Eykholt <jeykholt@cisco.com>
Tue, 25 Aug 2009 21:02:54 +0000 (14:02 -0700)
committerJames Bottomley <James.Bottomley@suse.de>
Thu, 10 Sep 2009 17:07:56 +0000 (12:07 -0500)
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 <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/libfc/fc_disc.c

index 428421842f3ab2b261c6aaf7a54a564996908fad..1a699f484c85cd46f9fe1538d054fd9122ef19a5 100644 (file)
@@ -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;