devlink: fix return value check in devlink_dpipe_header_put()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 11 Apr 2017 16:02:02 +0000 (16:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 11 Apr 2017 18:53:32 +0000 (14:53 -0400)
Fix the return value check which testing the wrong variable
in devlink_dpipe_header_put().

Fixes: 1555d204e743 ("devlink: Support for pipeline debug (dpipe)")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/devlink.c

index 24b766003a610368a4e4b23afadd49f651b5a2cc..0afac5800b57bdb525923f77acbd532072e21e58 100644 (file)
@@ -2031,7 +2031,7 @@ static int devlink_dpipe_header_put(struct sk_buff *skb,
        int err;
 
        header_attr = nla_nest_start(skb, DEVLINK_ATTR_DPIPE_HEADER);
-       if (!header)
+       if (!header_attr)
                return -EMSGSIZE;
 
        if (nla_put_string(skb, DEVLINK_ATTR_DPIPE_HEADER_NAME, header->name) ||