diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c index f2a9a33b47a1f2b615609cb0b8a13b4361074e79..a15e3c7d21d3d80886702e3ec5b36e64cdb449ee 100644 --- a/drivers/firewire/fw-sbp2.c +++ b/drivers/firewire/fw-sbp2.c @@ -716,7 +716,11 @@ static void sbp2_login(struct work_struct *work) sdev = __scsi_add_device(shost, 0, 0, scsilun_to_int(&eight_bytes_lun), lu); if (IS_ERR(sdev)) { - sbp2_send_management_orb(lu, node_id, generation, + smp_rmb(); /* generation may have changed */ + generation = device->generation; + smp_rmb(); /* node_id must not be older than generation */ + + sbp2_send_management_orb(lu, device->node_id, generation, SBP2_LOGOUT_REQUEST, lu->login_id, NULL); /* * Set this back to sbp2_login so we fall back and