From: Patrick McHardy <kaber@trash.net>
To: Julius Volz <juliusv@google.com>
Cc: davem@davemloft.net, samuel@sortiz.org, netdev@vger.kernel.org
Subject: Re: [PATCH] IRDA: Fix genlmsg_put() return value check.
Date: Mon, 23 Jun 2008 21:43:31 +0200 [thread overview]
Message-ID: <485FFCE3.2050800@trash.net> (raw)
In-Reply-To: <1214248629-6208-1-git-send-email-juliusv@google.com>
Julius Volz wrote:
> 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;
> }
Good catch, but the correct return value for insufficient
space in the skb is -ENOSPC.
next prev parent reply other threads:[~2008-06-23 19:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-23 19:17 [PATCH] IRDA: Fix genlmsg_put() return value check Julius Volz
2008-06-23 19:43 ` Patrick McHardy [this message]
2008-06-23 20:13 ` samuel
2008-06-23 20:29 ` Julius Volz
2008-06-23 23:54 ` Patrick McHardy
2008-06-24 9:18 ` Julius Volz
2008-06-24 9:29 ` Julius Volz
2008-06-28 3:01 ` David Miller
2008-06-30 7:11 ` samuel
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=485FFCE3.2050800@trash.net \
--to=kaber@trash.net \
--cc=davem@davemloft.net \
--cc=juliusv@google.com \
--cc=netdev@vger.kernel.org \
--cc=samuel@sortiz.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).