summaryrefslogtreecommitdiff
path: root/drivers/staging/ozwpan
diff options
context:
space:
mode:
authorRupesh Gujare <rupesh.gujare@atmel.com>2013-08-23 18:33:32 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-26 06:27:43 -0700
commit37bc8f7856fc0c851980f01174ca936741511523 (patch)
tree6d5942044d11d534e230a9e8eb9581111b0bde66 /drivers/staging/ozwpan
parent4882ad9561d2a719ac9fb269bf0567141fd9892e (diff)
staging: ozwpan: Fix error checking while transmitting frame.
Make sure that we return negative value if oz_build_frame() returns NULL. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ozwpan')
-rw-r--r--drivers/staging/ozwpan/ozpd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c
index daaff2af14ae..e1757aa27253 100644
--- a/drivers/staging/ozwpan/ozpd.c
+++ b/drivers/staging/ozwpan/ozpd.c
@@ -618,14 +618,14 @@ static int oz_send_next_queued_frame(struct oz_pd *pd, int more_data)
pd->last_sent_frame = e;
skb = oz_build_frame(pd, f);
spin_unlock(&pd->tx_frame_lock);
+ if (!skb)
+ return -1;
if (more_data)
oz_set_more_bit(skb);
oz_dbg(TX_FRAMES, "TX frame PN=0x%x\n", f->hdr.pkt_num);
- if (skb) {
- if (dev_queue_xmit(skb) < 0)
- return -1;
+ if (dev_queue_xmit(skb) < 0)
+ return -1;
- }
return 0;
}