Skip to content

Commit 71abf20

Browse files
Bob Pearsonjgunthorpe
authored andcommitted
RDMA/rxe: Handle skb_clone() failure in rxe_recv.c
If skb_clone() is unable to allocate memory for a new sk_buff this is not detected by the current code. Check for a NULL return and continue. This is similar to other errors in this loop over QPs attached to the multicast address and consistent with the unreliable UD transport. Fixes: e7ec96f ("RDMA/rxe: Fix skb lifetime in rxe_rcv_mcast_pkt()") Addresses-Coverity-ID: 1497804: Null pointer dereferences (NULL_RETURNS) Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bob Pearson <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent e0d696d commit 71abf20

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/infiniband/sw/rxe/rxe_recv.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct sk_buff *skb)
271271
else
272272
per_qp_skb = skb;
273273

274+
if (unlikely(!per_qp_skb))
275+
continue;
276+
274277
per_qp_pkt = SKB_TO_PKT(per_qp_skb);
275278
per_qp_pkt->qp = qp;
276279
rxe_add_ref(qp);

0 commit comments

Comments
 (0)