Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 13974909 authored by Dan Carpenter's avatar Dan Carpenter Committed by Roland Dreier
Browse files

IB/mlx4: Handle -ENOMEM in forward_trap()



ib_create_send_mad() can return ERR_PTR(-ENOMEM) here.

Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 030b4b33
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -211,6 +211,8 @@ static void forward_trap(struct mlx4_ib_dev *dev, u8 port_num, struct ib_mad *ma
	if (agent) {
	if (agent) {
		send_buf = ib_create_send_mad(agent, qpn, 0, 0, IB_MGMT_MAD_HDR,
		send_buf = ib_create_send_mad(agent, qpn, 0, 0, IB_MGMT_MAD_HDR,
					      IB_MGMT_MAD_DATA, GFP_ATOMIC);
					      IB_MGMT_MAD_DATA, GFP_ATOMIC);
		if (IS_ERR(send_buf))
			return;
		/*
		/*
		 * We rely here on the fact that MLX QPs don't use the
		 * We rely here on the fact that MLX QPs don't use the
		 * address handle after the send is posted (this is
		 * address handle after the send is posted (this is