Skip to content

Commit

Permalink
irda: Fix netlink error path return value
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Julius Volz authored and David S. Miller committed Jul 8, 2008
1 parent 0230708 commit 07035fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/irda/irnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = -EMSGSIZE;
goto err_out;
}

Expand Down

0 comments on commit 07035fc

Please sign in to comment.