summaryrefslogtreecommitdiffstats
path: root/drivers/ntb/test
diff options
context:
space:
mode:
authorYang Li <yang.lee@linux.alibaba.com>2021-06-07 16:40:36 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-09-22 11:48:13 +0200
commita3e968b65cd5bc1578438a5436339640f1b79342 (patch)
treec04504034f1b0803920fb44d9e1f2a69a9725b73 /drivers/ntb/test
parent86e6540a230281cc913e9e2a39953360b9924859 (diff)
downloadlinux-stable-a3e968b65cd5bc1578438a5436339640f1b79342.tar.gz
linux-stable-a3e968b65cd5bc1578438a5436339640f1b79342.tar.bz2
linux-stable-a3e968b65cd5bc1578438a5436339640f1b79342.zip
NTB: perf: Fix an error code in perf_setup_inbuf()
[ Upstream commit 0097ae5f7af5684f961a5f803ff7ad3e6f933668 ] When the function IS_ALIGNED() returns false, the value of ret is 0. So, we set ret to -EINVAL to indicate this error. Clean up smatch warning: drivers/ntb/test/ntb_perf.c:602 perf_setup_inbuf() warn: missing error code 'ret'. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/ntb/test')
-rw-r--r--drivers/ntb/test/ntb_perf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
index ad5d3919435c..87a41d0ededc 100644
--- a/drivers/ntb/test/ntb_perf.c
+++ b/drivers/ntb/test/ntb_perf.c
@@ -600,6 +600,7 @@ static int perf_setup_inbuf(struct perf_peer *peer)
return -ENOMEM;
}
if (!IS_ALIGNED(peer->inbuf_xlat, xlat_align)) {
+ ret = -EINVAL;
dev_err(&perf->ntb->dev, "Unaligned inbuf allocated\n");
goto err_free_inbuf;
}