devlink: fix return value check in devlink_dpipe_header_put()

Fix the return value check which testing the wrong variable
in devlink_dpipe_header_put().

Fixes: 1555d204e7 ("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>
This commit is contained in:
Wei Yongjun 2017-04-11 16:02:02 +00:00 committed by David S. Miller
parent b46b99d785
commit cb6bf9cfdb

View 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) ||