summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-01-16 13:40:22 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-02-13 10:19:49 +0100
commit22f16a74c4744f8b0d83fd0d031be2137e764cbf (patch)
tree62beb2a4b1133079959b8f2ffdaade42efc66146 /drivers/scsi
parentf18046f7a50accf76dab9c6ab274a7e38143a0dc (diff)
scsi: storvsc: missing error code in storvsc_probe()
commit ca8dc694045e9aa248e9916e0f614deb0494cb3d upstream. We should set the error code if fc_remote_port_add() fails. Cc: <stable@vger.kernel.org> #v4.12+ Fixes: daf0cd445a21 ("scsi: storvsc: Add support for FC rport.") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Cathy Avery <cavery@redhat.com> Acked-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Long Li <longli@microsoft.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/storvsc_drv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 5e7200f05873..c17ccb913fde 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1826,8 +1826,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_out3;
+ }
}
#endif
return 0;