aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJedrzej Jagielski <[email protected]>2025-04-10 12:59:54 +0000
committerTony Nguyen <[email protected]>2025-04-15 14:36:31 +0000
commit8982fc03fd630a38c0d0ebddef768b4d4707b659 (patch)
tree4f84c26573de7c5c416cebd30166d09b49dfe4a1
parentnet: ncsi: Fix GCPS 64-bit member variables (diff)
downloadkernel-8982fc03fd630a38c0d0ebddef768b4d4707b659.tar.gz
kernel-8982fc03fd630a38c0d0ebddef768b4d4707b659.zip
devlink: add value check to devlink_info_version_put()
Prevent from proceeding if there's nothing to print. Suggested-by: Przemek Kitszel <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Reviewed-by: Kalesh AP <[email protected]> Tested-by: Bharath R <[email protected]> Signed-off-by: Jedrzej Jagielski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
-rw-r--r--net/devlink/dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/devlink/dev.c b/net/devlink/dev.c
index d6e3db300acb..02602704bdea 100644
--- a/net/devlink/dev.c
+++ b/net/devlink/dev.c
@@ -775,7 +775,7 @@ static int devlink_info_version_put(struct devlink_info_req *req, int attr,
req->version_cb(version_name, version_type,
req->version_cb_priv);
- if (!req->msg)
+ if (!req->msg || !*version_value)
return 0;
nest = nla_nest_start_noflag(req->msg, attr);