aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/mic/scif/scif_api.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2018-09-20 08:32:20 -0700
committerMark Brown <broonie@kernel.org>2018-09-20 08:32:20 -0700
commitd7b33ebae7c1419ebdfd94eb64bf74a7ec760031 (patch)
tree67dbc2149bb00e2eaf89c31a515e1f8bfc0dc8cb /drivers/misc/mic/scif/scif_api.c
parente1d176680ed4f6970582086191eb7377a80a2d4e (diff)
parent1244bbb3e92135d247e2dddfa6fe5e3e171a9635 (diff)
Merge tag 'v4.14.71' into linux-linaro-lsk-v4.14
This is the 4.14.71 stable release
Diffstat (limited to 'drivers/misc/mic/scif/scif_api.c')
-rw-r--r--drivers/misc/mic/scif/scif_api.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/misc/mic/scif/scif_api.c b/drivers/misc/mic/scif/scif_api.c
index ddc9e4b08b5c..56efa9d18a9a 100644
--- a/drivers/misc/mic/scif/scif_api.c
+++ b/drivers/misc/mic/scif/scif_api.c
@@ -370,11 +370,10 @@ int scif_bind(scif_epd_t epd, u16 pn)
goto scif_bind_exit;
}
} else {
- pn = scif_get_new_port();
- if (!pn) {
- ret = -ENOSPC;
+ ret = scif_get_new_port();
+ if (ret < 0)
goto scif_bind_exit;
- }
+ pn = ret;
}
ep->state = SCIFEP_BOUND;
@@ -648,13 +647,12 @@ int __scif_connect(scif_epd_t epd, struct scif_port_id *dst, bool non_block)
err = -EISCONN;
break;
case SCIFEP_UNBOUND:
- ep->port.port = scif_get_new_port();
- if (!ep->port.port) {
- err = -ENOSPC;
- } else {
- ep->port.node = scif_info.nodeid;
- ep->conn_async_state = ASYNC_CONN_IDLE;
- }
+ err = scif_get_new_port();
+ if (err < 0)
+ break;
+ ep->port.port = err;
+ ep->port.node = scif_info.nodeid;
+ ep->conn_async_state = ASYNC_CONN_IDLE;
/* Fall through */
case SCIFEP_BOUND:
/*