]> git.baikalelectronics.ru Git - kernel.git/commit
net: devlink: limit flash component name to match version returned by info_get()
authorJiri Pirko <jiri@nvidia.com>
Wed, 24 Aug 2022 12:20:11 +0000 (14:20 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 25 Aug 2022 20:22:53 +0000 (13:22 -0700)
commitc7f1aeea3650f6548e7bfe3f8f33b7337b1b6799
treeb8c0ec9e33bbb6522be4209cbd0d4fcb5526c968
parentbaea3488b0ef451bf62f5ceb107c2682205055d6
net: devlink: limit flash component name to match version returned by info_get()

Limit the acceptance of component name passed to cmd_flash_update() to
match one of the versions returned by info_get(), marked by version type.
This makes things clearer and enforces 1:1 mapping between exposed
version and accepted flash component.

Check VERSION_TYPE_COMPONENT version type during cmd_flash_update()
execution by calling info_get() with different "req" context.
That causes info_get() to lookup the component name instead of
filling-up the netlink message.

Remove "UPDATE_COMPONENT" flag which becomes used.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/netdevsim/dev.c
include/net/devlink.h
net/core/devlink.c