netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Samuel Ortiz" <samuel@sortiz.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, irda-users@lists.sourceforge.net,
	Julius Volz <juliusv@google.com>
Subject: [PATCH 4/4] irda: Fix netlink error path return value
Date: Mon, 30 Jun 2008 21:23:55 +0200	[thread overview]
Message-ID: <20080630192754.518128980@sortiz.org> (raw)
In-Reply-To: 20080630192351.765611690@sortiz.org

[-- Attachment #1: irda_nl.patch --]
[-- Type: text/plain, Size: 938 bytes --]

From: Julius Volz <juliusv@google.com>

Fix an incorrect return value check of genlmsg_put() in irda_nl_get_mode().
genlmsg_put() does not use ERR_PTR() to encode return values, it just
returns NULL on error.

Signed-off-by: Julius Volz <juliusv@google.com>
Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
---
 net/irda/irnetlink.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: net-next-2.6/net/irda/irnetlink.c
===================================================================
--- net-next-2.6.orig/net/irda/irnetlink.c	2008-06-14 13:20:33.000000000 +0200
+++ net-next-2.6/net/irda/irnetlink.c	2008-06-30 21:03:13.000000000 +0200
@@ -101,8 +101,8 @@ static int irda_nl_get_mode(struct sk_bu
 
 	hdr = genlmsg_put(msg, info->snd_pid, info->snd_seq,
 			  &irda_nl_family, 0,  IRDA_NL_CMD_GET_MODE);
-	if (IS_ERR(hdr)) {
-		ret = PTR_ERR(hdr);
+	if (hdr == NULL) {
+		ret = -EMSGSIZE;
 		goto err_out;
 	}
 

-- 


  parent reply	other threads:[~2008-06-30 19:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-30 19:23 [PATCH 0/4] irda: IrDA updates for 2.6.26 Samuel Ortiz
2008-06-30 19:23 ` [PATCH 1/4] irda: via-ircc proper dma freeing Samuel Ortiz
2008-06-30 19:23 ` [PATCH 2/4] irda: Remove useless pm_dev references Samuel Ortiz
2008-06-30 19:23 ` [PATCH 3/4] irda: New device ID for nsc-ircc Samuel Ortiz
2008-06-30 19:23 ` Samuel Ortiz [this message]
     [not found] ` <20080630192351.765611690-jcdQHdrhKHMdnm+yROfE0A@public.gmane.org>
2008-06-30 19:59   ` [PATCH 0/4] irda: IrDA updates for 2.6.26 David Miller
2008-07-07 11:08     ` Samuel Ortiz
     [not found]       ` <20080707110839.GA2949-jcdQHdrhKHMdnm+yROfE0A@public.gmane.org>
2008-07-07 11:10         ` David Miller

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=20080630192754.518128980@sortiz.org \
    --to=samuel@sortiz.org \
    --cc=davem@davemloft.net \
    --cc=irda-users@lists.sourceforge.net \
    --cc=juliusv@google.com \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).