OSDN Git Service

devlink: don't work with possible NULL pointer in devlink_param_unregister()
authorJiri Pirko <jiri@nvidia.com>
Thu, 26 Jan 2023 07:58:30 +0000 (08:58 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Jan 2023 12:32:02 +0000 (12:32 +0000)
commitbb9bb6bfd1c37b1c0786248c2785536146603fa8
treea6e9844f2e1a1ff14e2f51c85e64c689553181c2
parent020dd127a3fef9dfc6c03cd5d1c231d5e55d7632
devlink: don't work with possible NULL pointer in devlink_param_unregister()

There is a WARN_ON checking the param_item for being NULL when the param
is not inserted in the list. That indicates a driver BUG. Instead of
continuing to work with NULL pointer with its consequences, return.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/devlink/leftover.c