Skip to content

Commit 0097ae5

Browse files
Yang Lijonmason
authored andcommitted
NTB: perf: Fix an error code in perf_setup_inbuf()
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>
1 parent 319f83a commit 0097ae5

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/ntb/test/ntb_perf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ static int perf_setup_inbuf(struct perf_peer *peer)
598598
return -ENOMEM;
599599
}
600600
if (!IS_ALIGNED(peer->inbuf_xlat, xlat_align)) {
601+
ret = -EINVAL;
601602
dev_err(&perf->ntb->dev, "Unaligned inbuf allocated\n");
602603
goto err_free_inbuf;
603604
}

0 commit comments

Comments
 (0)