mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rupesh Gujare <rupesh.gujare@atmel.com>
To: <devel@linuxdriverproject.org>
Cc: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<gregkh@linuxfoundation.org>
Subject: [PATCH 5/6] staging: ozwpan: Fix error checking while transmitting frame.
Date: Fri, 23 Aug 2013 18:33:32 +0100	[thread overview]
Message-ID: <1377279213-17074-5-git-send-email-rupesh.gujare@atmel.com> (raw)
In-Reply-To: <1377279213-17074-1-git-send-email-rupesh.gujare@atmel.com>

Make sure that we return negative value if oz_build_frame()
returns NULL.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
---
 drivers/staging/ozwpan/ozpd.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c
index daaff2a..e1757aa 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;
 }
 
-- 
1.7.9.5


  parent reply	other threads:[~2013-08-23 17:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-23 17:33 [PATCH 1/6] staging: ozwpan: Check for correct config number Rupesh Gujare
2013-08-23 17:33 ` [PATCH 2/6] staging: ozwpan: Convert hard coded value to Macro Rupesh Gujare
2013-08-23 17:33 ` [PATCH 3/6] staging: ozwpan: Increase interrupt end point buffer size Rupesh Gujare
2013-08-23 17:33 ` [PATCH 4/6] staging: ozwpan: change variable type Rupesh Gujare
2013-08-23 17:33 ` Rupesh Gujare [this message]
2013-08-23 17:33 ` [PATCH 6/6] staging: ozwpan: change max. TX frame size supported Rupesh Gujare
2013-08-30 12:52   ` Mark Einon
2013-08-30 12:59   ` Mark Einon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1377279213-17074-5-git-send-email-rupesh.gujare@atmel.com \
    --to=rupesh.gujare@atmel.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®