Ver Fonte

firewire: Zero out sd->scsi_host if we fail to register with the SCSI stack.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Kristian Høgsberg há 18 anos atrás
pai
commit
693b902176
1 ficheiros alterados com 2 adições e 0 exclusões
  1. 2 0
      drivers/firewire/fw-sbp2.c

+ 2 - 0
drivers/firewire/fw-sbp2.c

@@ -1099,6 +1099,7 @@ static int add_scsi_devices(struct fw_unit *unit)
 	if (retval < 0) {
 		fw_error("failed to add scsi host\n");
 		scsi_host_put(sd->scsi_host);
+		sd->scsi_host = NULL;
 		return retval;
 	}
 
@@ -1109,6 +1110,7 @@ static int add_scsi_devices(struct fw_unit *unit)
 		fw_error("failed to add scsi device\n");
 		scsi_remove_host(sd->scsi_host);
 		scsi_host_put(sd->scsi_host);
+		sd->scsi_host = NULL;
 		return retval;
 	}