Skip to content

Commit

Permalink
scsi: storvsc: missing error code in storvsc_probe()
Browse files Browse the repository at this point in the history
We should set the error code if fc_remote_port_add() fails.

Cc: <stable@vger.kernel.org> #v4.12+
Fixes: daf0cd4 ("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>
  • Loading branch information
Dan Carpenter authored and Martin K. Petersen committed Jan 17, 2018
1 parent 332b4b2 commit ca8dc69
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/scsi/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1833,8 +1833,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;
Expand Down

0 comments on commit ca8dc69

Please sign in to comment.