From: Wei Yongjun Date: Tue, 11 Apr 2017 16:02:02 +0000 (+0000) Subject: devlink: fix return value check in devlink_dpipe_header_put() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=cb6bf9cfdb5e26dfb7eb9b955b2f24d82703e27d;p=openwrt%2Fstaging%2Fblogic.git 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: 1555d204e743 ("devlink: Support for pipeline debug (dpipe)") Signed-off-by: Wei Yongjun Acked-by: Jiri Pirko Signed-off-by: David S. Miller --- diff --git a/net/core/devlink.c b/net/core/devlink.c index 24b766003a61..0afac5800b57 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -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) ||