devlink: Enhance policy to validate eswitch mode value
authorParav Pandit <parav@nvidia.com>
Mon, 21 Sep 2020 16:41:29 +0000 (19:41 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Sep 2020 00:38:42 +0000 (17:38 -0700)
commitba356c90985defec30c8680077bf571a50a4004b
tree385db55b763ff0c6cb38d98941e4dca0f2a21f2f
parent3ab0a7a0c349a1d7beb2bb371a62669d1528269d
devlink: Enhance policy to validate eswitch mode value

Use range checking facility of nla_policy to validate eswitch mode input
attribute value is valid or not.

Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/devlink.c