summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Graul <kgraul@linux.ibm.com>2020-10-23 20:48:29 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-01 12:47:07 +0100
commitbddce770def13fc2f19715f658a7f9dceb1de80e (patch)
tree2685d035d90f838c7474af7867f5a30144015ffb
parente7935fa6b9259de0f10be450bb9f8063edd184ad (diff)
downloadlinux-stable-bddce770def13fc2f19715f658a7f9dceb1de80e.tar.gz
linux-stable-bddce770def13fc2f19715f658a7f9dceb1de80e.tar.bz2
linux-stable-bddce770def13fc2f19715f658a7f9dceb1de80e.zip
net/smc: fix suppressed return code
[ Upstream commit 96d6fded958d971a3695009e0ed43aca6c598283 ] The patch that repaired the invalid return code in smcd_new_buf_create() missed to take care of errno ENOSPC which has a special meaning that no more DMBEs can be registered on the device. Fix that by keeping this errno value during the translation of the return code. Fixes: 6b1bbf94ab36 ("net/smc: fix invalid return code in smcd_new_buf_create()") Signed-off-by: Karsten Graul <kgraul@linux.ibm.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/smc/smc_core.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c
index 59cc99fec2a2..efa65ec5e686 100644
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -1616,8 +1616,11 @@ static struct smc_buf_desc *smcd_new_buf_create(struct smc_link_group *lgr,
rc = smc_ism_register_dmb(lgr, bufsize, buf_desc);
if (rc) {
kfree(buf_desc);
- return (rc == -ENOMEM) ? ERR_PTR(-EAGAIN) :
- ERR_PTR(-EIO);
+ if (rc == -ENOMEM)
+ return ERR_PTR(-EAGAIN);
+ if (rc == -ENOSPC)
+ return ERR_PTR(-ENOSPC);
+ return ERR_PTR(-EIO);
}
buf_desc->pages = virt_to_page(buf_desc->cpu_addr);
/* CDC header stored in buf. So, pretend it was smaller */