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

Commit 3e02a06a authored by Dan Carpenter's avatar Dan Carpenter Committed by Inaky Perez-Gonzalez
Browse files

wimax: wimax_msg_alloc() returns ERR_PTR not null



wimax_msg_alloc() returns an ERR_PTR and not null.  I changed it to test
for ERR_PTR instead of null.  I also added a check in front of the
kfree() because kfree() can handle null but not ERR_PTR.

Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
parent d3e56c0a
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -300,16 +300,15 @@ void i2400m_rx_ctl_ack(struct i2400m *i2400m,
		d_printf(1, dev, "Huh? waiter for command reply cancelled\n");
		goto error_waiter_cancelled;
	}
	if (ack_skb == NULL) {
	if (IS_ERR(ack_skb))
		dev_err(dev, "CMD/GET/SET ack: cannot allocate SKB\n");
		i2400m->ack_skb = ERR_PTR(-ENOMEM);
	} else
	i2400m->ack_skb = ack_skb;
	spin_unlock_irqrestore(&i2400m->rx_lock, flags);
	complete(&i2400m->msg_completion);
	return;

error_waiter_cancelled:
	if (!IS_ERR(ack_skb))
		kfree_skb(ack_skb);
error_no_waiter:
	spin_unlock_irqrestore(&i2400m->rx_lock, flags);