]> git.baikalelectronics.ru Git - kernel.git/commit
devlink: Add helper function for safely copy string param
authorMoshe Shemesh <moshe@mellanox.com>
Wed, 10 Oct 2018 13:09:27 +0000 (16:09 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Oct 2018 17:19:10 +0000 (10:19 -0700)
commitd1937996066446be5a95f90095e5322911a14d59
tree834c7d34a735b3be2621f897c76275bd6427f694
parent23e961070d8b4266c8da4c71046808ab52b09697
devlink: Add helper function for safely copy string param

Devlink string param buffer is allocated at the size of
DEVLINK_PARAM_MAX_STRING_VALUE. Add helper function which makes sure
this size is not exceeded.
Renamed DEVLINK_PARAM_MAX_STRING_VALUE to
__DEVLINK_PARAM_MAX_STRING_VALUE to emphasize that it should be used by
devlink only. The driver should use the helper function instead to
verify it doesn't exceed the allowed length.

Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/devlink.h
net/core/devlink.c