diff mbox

[net-next,v2] devlink: fix return value check in devlink_dpipe_header_put()

Message ID 20170411160202.17469-1-weiyj.lk@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Wei Yongjun April 11, 2017, 4:02 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

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>
---
v1 -> v2: fix  a typo in patch comment
---
 net/core/devlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller April 11, 2017, 6:53 p.m. UTC | #1
From: Wei Yongjun <weiyj.lk@gmail.com>
Date: Tue, 11 Apr 2017 16:02:02 +0000

> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> 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>
> ---
> v1 -> v2: fix  a typo in patch comment

Applied, thanks.
diff mbox

Patch

diff --git a/net/core/devlink.c b/net/core/devlink.c
index 24b7660..0afac58 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) ||