Skip to contentSkip to conversation

scsi: storvsc: missing error code in storvsc_probe()

PATCH Applied Dan Carpenter 4 participants 4 messages Jan 16, 2018 – Jan 17, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: storvsc: missing error code in storvsc_probe()

We should set the error code if fc_remote_port_add() fails.

Fixes daf0cd445a21 ("scsi: storvsc: Add support for FC rport.")
drivers/scsi/storvsc_drv.c +3 -1
index 3b3d1d050cac..40fc7a590e81 100644
@@ -1834,8 +1834,10 @@ static int storvsc_probe(struct hv_device *device,
 		fc_host_node_name(host) = stor_device->node_name;
 		fc_host_port_name(host) = stor_device->port_name;
 		stor_device->rport = fc_remote_port_add(host, 0, &ids);
-		if (!stor_device->rport)
+		if (!stor_device->rport) {
+			ret = -ENOMEM;
 			goto err_out4;
+		}
 	}
 #endif
 	return 0;
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Dan Carpenter

We should set the error code if fc_remote_port_add() fails.

Fixes daf0cd445a21 ("scsi: storvsc: Add support for FC rport.")
drivers/scsi/storvsc_drv.c +0 -0
index 3b3d1d050cac..40fc7a590e81 100644
@@ -1834,8 +1834,10 @@ static int storvsc_probe(struct hv_device *device,
  		fc_host_node_name(host) = stor_device->node_name;

drivers/scsi/storvsc_drv.c static int storvsc_probe(struct hv_device *device, · line 1843

Quoted 10 lines
drivers/scsi/storvsc_drv.c +3 -1
  		fc_host_port_name(host) = stor_device->port_name;
  		stor_device->rport = fc_remote_port_add(host, 0, &ids);
-		if (!stor_device->rport)
+		if (!stor_device->rport) {
+			ret = -ENOMEM;
  			goto err_out4;
+		}
  	}
  #endif
  	return 0;
Acked-by
#2 lore raw
Quoted 26 lines

-----Original Message-----
From: Cathy Avery [mailto:[email protected]]
Sent: Tuesday, January 16, 2018 6:36 AM
To: Dan Carpenter <[email protected]>; KY Srinivasan <[email protected]>
Cc: Haiyang Zhang <[email protected]>; Stephen Hemminger <[email protected]>; James E.J. Bottomley <[email protected]>; Martin K. Petersen <[email protected]>; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [PATCH] scsi: storvsc: missing error code in storvsc_probe()

drivers/scsi/storvsc_drv.c static int storvsc_probe(struct hv_device

Quoted 10 lines · Dan Carpenter

We should set the error code if fc_remote_port_add() fails.

Fixes daf0cd445a21 ("scsi: storvsc: Add support for FC rport.")
drivers/scsi/storvsc_drv.c +0 -0
index 3b3d1d050cac..40fc7a590e81 100644
@@ -1834,8 +1834,10 @@ static int storvsc_probe(struct hv_device

*device,

Quoted 13 lines

drivers/scsi/storvsc_drv.c static int storvsc_probe(struct hv_device *device, · line 1843

Quoted 11 lines
drivers/scsi/storvsc_drv.c +3 -1
  		fc_host_node_name(host) = stor_device->node_name;
  		fc_host_port_name(host) = stor_device->port_name;
  		stor_device->rport = fc_remote_port_add(host, 0, &ids);
-		if (!stor_device->rport)
+		if (!stor_device->rport) {
+			ret = -ENOMEM;
  			goto err_out4;
+		}
  	}
  #endif
  	return 0;
#3 lore raw
In reply to Dan Carpenter

Dan,

Quoted 1 line

We should set the error code if fc_remote_port_add() fails.

Applied to 4.16/scsi-queue, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering