diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-02-08 16:31:52 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-02-10 09:30:24 +0300 |
commit | d4545bf9c33baa482daea845ddf8d5fdb26daee3 (patch) | |
tree | 67cfdb7d6f951ad9687ffc033471c61e8b33921c /net/netlink/genetlink.c | |
parent | f1db99c07b4f0a9edc45f3498d4d13d13a41836a (diff) | |
download | linux-d4545bf9c33baa482daea845ddf8d5fdb26daee3.tar.xz |
genetlink: Use string_is_terminated() helper
Use string_is_terminated() helper instead of cpecific memchr() call.
This shows better the intention of the call.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20230208133153.22528-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/netlink/genetlink.c')
-rw-r--r-- | net/netlink/genetlink.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 600993c80050..04c4036bf406 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c @@ -13,7 +13,7 @@ #include <linux/errno.h> #include <linux/types.h> #include <linux/socket.h> -#include <linux/string.h> +#include <linux/string_helpers.h> #include <linux/skbuff.h> #include <linux/mutex.h> #include <linux/bitmap.h> @@ -457,7 +457,7 @@ static int genl_validate_assign_mc_groups(struct genl_family *family) if (WARN_ON(grp->name[0] == '\0')) return -EINVAL; - if (WARN_ON(memchr(grp->name, '\0', GENL_NAMSIZ) == NULL)) + if (WARN_ON(!string_is_terminated(grp->name, GENL_NAMSIZ))) return -EINVAL; } |