From: Dan Carpenter Date: Tue, 16 Jan 2018 10:40:22 +0000 (+0300) Subject: scsi: storvsc: missing error code in storvsc_probe() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=22f16a74c4744f8b0d83fd0d031be2137e764cbf;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git scsi: storvsc: missing error code in storvsc_probe() commit ca8dc694045e9aa248e9916e0f614deb0494cb3d upstream. We should set the error code if fc_remote_port_add() fails. Cc: #v4.12+ Fixes: daf0cd445a21 ("scsi: storvsc: Add support for FC rport.") Signed-off-by: Dan Carpenter Reviewed-by: Cathy Avery Acked-by: K. Y. Srinivasan Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman Signed-off-by: Long Li --- 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;