aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-04-22 05:46:32 -0400
committerInaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>2010-05-11 17:09:19 -0400
commit3e02a06ae3dce2eb804bb4afadb7067c80d6c096 (patch)
treec0b8c7ce06597a04d4521700cbf4d0412c9fb1b4
parentd3e56c0ad8a2dab7ffd6179b64f00702149e5c9a (diff)
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: Dan Carpenter <error27@gmail.com>
-rw-r--r--drivers/net/wimax/i2400m/rx.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/wimax/i2400m/rx.c b/drivers/net/wimax/i2400m/rx.c
index 66f968a24d49..0004c686ac68 100644
--- a/drivers/net/wimax/i2400m/rx.c
+++ b/drivers/net/wimax/i2400m/rx.c
@@ -300,17 +300,16 @@ void i2400m_rx_ctl_ack(struct i2400m *i2400m,
300 d_printf(1, dev, "Huh? waiter for command reply cancelled\n"); 300 d_printf(1, dev, "Huh? waiter for command reply cancelled\n");
301 goto error_waiter_cancelled; 301 goto error_waiter_cancelled;
302 } 302 }
303 if (ack_skb == NULL) { 303 if (IS_ERR(ack_skb))
304 dev_err(dev, "CMD/GET/SET ack: cannot allocate SKB\n"); 304 dev_err(dev, "CMD/GET/SET ack: cannot allocate SKB\n");
305 i2400m->ack_skb = ERR_PTR(-ENOMEM); 305 i2400m->ack_skb = ack_skb;
306 } else
307 i2400m->ack_skb = ack_skb;
308 spin_unlock_irqrestore(&i2400m->rx_lock, flags); 306 spin_unlock_irqrestore(&i2400m->rx_lock, flags);
309 complete(&i2400m->msg_completion); 307 complete(&i2400m->msg_completion);
310 return; 308 return;
311 309
312error_waiter_cancelled: 310error_waiter_cancelled:
313 kfree_skb(ack_skb); 311 if (!IS_ERR(ack_skb))
312 kfree_skb(ack_skb);
314error_no_waiter: 313error_no_waiter:
315 spin_unlock_irqrestore(&i2400m->rx_lock, flags); 314 spin_unlock_irqrestore(&i2400m->rx_lock, flags);
316 return; 315 return;