]> git.baikalelectronics.ru Git - kernel.git/commit
IB/core: remove redundant check on prot_sg_cnt
authorColin Ian King <colin.king@canonical.com>
Mon, 9 Oct 2017 16:12:00 +0000 (17:12 +0100)
committerDoug Ledford <dledford@redhat.com>
Tue, 10 Oct 2017 14:49:45 +0000 (10:49 -0400)
commitf5d288d6d3e6673a21ae5cda8d241cd59d961f14
tree39d9d69fbecd03023dbc676208000dd5fadc256a
parent0d0a64bd5cdbf554f50728e177af7297c82da328
IB/core: remove redundant check on prot_sg_cnt

prot_sg_cnt cannot be zero as a previous check on ret (from which
prot_sg_cnt is assigned) returns -ENOMEM if is it zero.  Since
it cannot be zero we can simplify the code by removing the non
-zero check on prot_sg_cnt and redundant else statement.

Detected by CoverityScan, COD#1357188 ("Logically dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/rw.c