Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 935d0fce authored by Joe Eykholt's avatar Joe Eykholt Committed by James Bottomley
Browse files

[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: default avatarJoe Eykholt <jeykholt@cisco.com>
Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 29d898e9
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -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)
static void fc_disc_restart(struct fc_disc *disc)
{
{
	if (!disc->disc_callback)
		return;

	FC_DISC_DBG(disc, "Restarting discovery\n");
	FC_DISC_DBG(disc, "Restarting discovery\n");


	disc->requested = 1;
	disc->requested = 1;