From: Zhu Yanjun Date: Thu, 14 Jun 2018 09:45:42 +0000 (-0400) Subject: IB/rxe: avoid unnecessary NULL check X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b90575ce7b84483d46ebedd5c164e5f274f7ce5a;p=linux.git IB/rxe: avoid unnecessary NULL check Before goto err2, the variable qp is checked. So it is not necessary to check qp in label err2. Signed-off-by: Zhu Yanjun Reviewed-by: Leon Romanovsky Reviewed-by: Yuval Shaia Signed-off-by: Jason Gunthorpe --- diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c b/drivers/infiniband/sw/rxe/rxe_recv.c index 42797ac6f7b16..cc5cfd156758e 100644 --- a/drivers/infiniband/sw/rxe/rxe_recv.c +++ b/drivers/infiniband/sw/rxe/rxe_recv.c @@ -256,8 +256,7 @@ static int hdr_check(struct rxe_pkt_info *pkt) return 0; err2: - if (qp) - rxe_drop_ref(qp); + rxe_drop_ref(qp); err1: return -EINVAL; }