]> git.itanic.dy.fi Git - linux-stable/blobdiff - net/smc/smc_core.c
net/smc: Stop the CLC flow if no link to map buffers on
[linux-stable] / net / smc / smc_core.c
index 1f3bb1f6b1f7b164878fbf4212293abaf7b4d31b..8095876b66eb6660f6d1e61ec4fea45116e50c7f 100644 (file)
@@ -2148,7 +2148,7 @@ static struct smc_buf_desc *smcr_new_buf_create(struct smc_link_group *lgr,
 static int smcr_buf_map_usable_links(struct smc_link_group *lgr,
                                     struct smc_buf_desc *buf_desc, bool is_rmb)
 {
-       int i, rc = 0;
+       int i, rc = 0, cnt = 0;
 
        /* protect against parallel link reconfiguration */
        mutex_lock(&lgr->llc_conf_mutex);
@@ -2161,9 +2161,12 @@ static int smcr_buf_map_usable_links(struct smc_link_group *lgr,
                        rc = -ENOMEM;
                        goto out;
                }
+               cnt++;
        }
 out:
        mutex_unlock(&lgr->llc_conf_mutex);
+       if (!rc && !cnt)
+               rc = -EINVAL;
        return rc;
 }