diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-09-24 14:29:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-27 13:18:19 -0400 |
commit | 7f8436a1269eaaf2d0b1054a325eddf4e14cb80d (patch) | |
tree | bc39da0b5949f1eebe0241007db5fd70243490f4 /net/l2tp | |
parent | 392b408782324e62709f080a84de2866f7b125d4 (diff) |
l2tp: fix return value check
In case of error, the function genlmsg_put() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.
dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/l2tp')
-rw-r--r-- | net/l2tp/l2tp_netlink.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c index d71cd9229a47..6f936358d664 100644 --- a/net/l2tp/l2tp_netlink.c +++ b/net/l2tp/l2tp_netlink.c | |||
@@ -80,8 +80,8 @@ static int l2tp_nl_cmd_noop(struct sk_buff *skb, struct genl_info *info) | |||
80 | 80 | ||
81 | hdr = genlmsg_put(msg, info->snd_pid, info->snd_seq, | 81 | hdr = genlmsg_put(msg, info->snd_pid, info->snd_seq, |
82 | &l2tp_nl_family, 0, L2TP_CMD_NOOP); | 82 | &l2tp_nl_family, 0, L2TP_CMD_NOOP); |
83 | if (IS_ERR(hdr)) { | 83 | if (!hdr) { |
84 | ret = PTR_ERR(hdr); | 84 | ret = -EMSGSIZE; |
85 | goto err_out; | 85 | goto err_out; |
86 | } | 86 | } |
87 | 87 | ||
@@ -250,8 +250,8 @@ static int l2tp_nl_tunnel_send(struct sk_buff *skb, u32 pid, u32 seq, int flags, | |||
250 | 250 | ||
251 | hdr = genlmsg_put(skb, pid, seq, &l2tp_nl_family, flags, | 251 | hdr = genlmsg_put(skb, pid, seq, &l2tp_nl_family, flags, |
252 | L2TP_CMD_TUNNEL_GET); | 252 | L2TP_CMD_TUNNEL_GET); |
253 | if (IS_ERR(hdr)) | 253 | if (!hdr) |
254 | return PTR_ERR(hdr); | 254 | return -EMSGSIZE; |
255 | 255 | ||
256 | if (nla_put_u8(skb, L2TP_ATTR_PROTO_VERSION, tunnel->version) || | 256 | if (nla_put_u8(skb, L2TP_ATTR_PROTO_VERSION, tunnel->version) || |
257 | nla_put_u32(skb, L2TP_ATTR_CONN_ID, tunnel->tunnel_id) || | 257 | nla_put_u32(skb, L2TP_ATTR_CONN_ID, tunnel->tunnel_id) || |
@@ -617,8 +617,8 @@ static int l2tp_nl_session_send(struct sk_buff *skb, u32 pid, u32 seq, int flags | |||
617 | sk = tunnel->sock; | 617 | sk = tunnel->sock; |
618 | 618 | ||
619 | hdr = genlmsg_put(skb, pid, seq, &l2tp_nl_family, flags, L2TP_CMD_SESSION_GET); | 619 | hdr = genlmsg_put(skb, pid, seq, &l2tp_nl_family, flags, L2TP_CMD_SESSION_GET); |
620 | if (IS_ERR(hdr)) | 620 | if (!hdr) |
621 | return PTR_ERR(hdr); | 621 | return -EMSGSIZE; |
622 | 622 | ||
623 | if (nla_put_u32(skb, L2TP_ATTR_CONN_ID, tunnel->tunnel_id) || | 623 | if (nla_put_u32(skb, L2TP_ATTR_CONN_ID, tunnel->tunnel_id) || |
624 | nla_put_u32(skb, L2TP_ATTR_SESSION_ID, session->session_id) || | 624 | nla_put_u32(skb, L2TP_ATTR_SESSION_ID, session->session_id) || |