diff options
Diffstat (limited to 'drivers/net/wimax/i2400m/rx.c')
-rw-r--r-- | drivers/net/wimax/i2400m/rx.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/net/wimax/i2400m/rx.c b/drivers/net/wimax/i2400m/rx.c index bcd411f1a854..82c200ad9fdc 100644 --- a/drivers/net/wimax/i2400m/rx.c +++ b/drivers/net/wimax/i2400m/rx.c | |||
@@ -177,8 +177,7 @@ void i2400m_report_hook_work(struct work_struct *ws) | |||
177 | struct i2400m_work *iw = | 177 | struct i2400m_work *iw = |
178 | container_of(ws, struct i2400m_work, ws); | 178 | container_of(ws, struct i2400m_work, ws); |
179 | struct i2400m_report_hook_args *args = (void *) iw->pl; | 179 | struct i2400m_report_hook_args *args = (void *) iw->pl; |
180 | if (iw->i2400m->ready) | 180 | i2400m_report_hook(iw->i2400m, args->l3l4_hdr, args->size); |
181 | i2400m_report_hook(iw->i2400m, args->l3l4_hdr, args->size); | ||
182 | kfree_skb(args->skb_rx); | 181 | kfree_skb(args->skb_rx); |
183 | i2400m_put(iw->i2400m); | 182 | i2400m_put(iw->i2400m); |
184 | kfree(iw); | 183 | kfree(iw); |
@@ -305,11 +304,12 @@ void i2400m_rx_ctl(struct i2400m *i2400m, struct sk_buff *skb_rx, | |||
305 | .l3l4_hdr = l3l4_hdr, | 304 | .l3l4_hdr = l3l4_hdr, |
306 | .size = size | 305 | .size = size |
307 | }; | 306 | }; |
308 | if (unlikely(i2400m->ready == 0)) /* only send if up */ | 307 | rmb(); /* see i2400m->ready's documentation */ |
309 | return; | 308 | if (likely(i2400m->ready)) { /* only send if up */ |
310 | skb_get(skb_rx); | 309 | skb_get(skb_rx); |
311 | i2400m_queue_work(i2400m, i2400m_report_hook_work, | 310 | i2400m_queue_work(i2400m, i2400m_report_hook_work, |
312 | GFP_KERNEL, &args, sizeof(args)); | 311 | GFP_KERNEL, &args, sizeof(args)); |
312 | } | ||
313 | if (unlikely(i2400m->trace_msg_from_user)) | 313 | if (unlikely(i2400m->trace_msg_from_user)) |
314 | wimax_msg(&i2400m->wimax_dev, "echo", | 314 | wimax_msg(&i2400m->wimax_dev, "echo", |
315 | l3l4_hdr, size, GFP_KERNEL); | 315 | l3l4_hdr, size, GFP_KERNEL); |
@@ -363,8 +363,6 @@ void i2400m_rx_trace(struct i2400m *i2400m, | |||
363 | msg_type & I2400M_MT_REPORT_MASK ? "REPORT" : "CMD/SET/GET", | 363 | msg_type & I2400M_MT_REPORT_MASK ? "REPORT" : "CMD/SET/GET", |
364 | msg_type, size); | 364 | msg_type, size); |
365 | d_dump(2, dev, l3l4_hdr, size); | 365 | d_dump(2, dev, l3l4_hdr, size); |
366 | if (unlikely(i2400m->ready == 0)) /* only send if up */ | ||
367 | return; | ||
368 | result = wimax_msg(wimax_dev, "trace", l3l4_hdr, size, GFP_KERNEL); | 366 | result = wimax_msg(wimax_dev, "trace", l3l4_hdr, size, GFP_KERNEL); |
369 | if (result < 0) | 367 | if (result < 0) |
370 | dev_err(dev, "error sending trace to userspace: %d\n", | 368 | dev_err(dev, "error sending trace to userspace: %d\n", |