[PATCH] IRDA: Fix genlmsg_put() return value check.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Julius Volz
Date: Monday, June 23, 2008 - 12:17 pm

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>
---
 net/irda/irnetlink.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/irda/irnetlink.c b/net/irda/irnetlink.c
index 9e1fb82..ea11cb4 100644
--- a/net/irda/irnetlink.c
+++ b/net/irda/irnetlink.c
@@ -101,8 +101,8 @@ static int irda_nl_get_mode(struct sk_buff *skb, struct genl_info *info)
 
 	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 = -ENOMEM;
 		goto err_out;
 	}
 
-- 
1.5.3.6

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] IRDA: Fix genlmsg_put() return value check., Julius Volz, (Mon Jun 23, 12:17 pm)
Re: [PATCH] IRDA: Fix genlmsg_put() return value check., Patrick McHardy, (Mon Jun 23, 12:43 pm)
Re: [PATCH] IRDA: Fix , samuel, (Mon Jun 23, 1:13 pm)
Re: [PATCH] IRDA: Fix genlmsg_put() return value check., Patrick McHardy, (Mon Jun 23, 4:54 pm)
[PATCH] IRDA: Fix genlmsg_put() return value check., Julius Volz, (Tue Jun 24, 2:29 am)
Re: [PATCH] IRDA: Fix genlmsg_put() return value check., David Miller, (Fri Jun 27, 8:01 pm)
Re: [PATCH] IRDA: Fix , samuel, (Mon Jun 30, 12:11 am)