mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
devlink: devl_resource_register(): differentiate error codes
Differentiate error codes of devl_resource_register(). Replace one of -EINVAL exit paths by -EEXIST. This should aid developers introducing new resources and registering them in the wrong order. Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Joe Damato <jdamato@fastly.com> Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Link: https://patch.msgid.link/20241023131248.27192-4-przemyslaw.kitszel@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
a788acf154
commit
e0b140c44f
@@ -345,7 +345,7 @@ int devl_resource_register(struct devlink *devlink,
|
||||
|
||||
resource = devlink_resource_find(devlink, NULL, resource_id);
|
||||
if (resource)
|
||||
return -EINVAL;
|
||||
return -EEXIST;
|
||||
|
||||
resource = kzalloc(sizeof(*resource), GFP_KERNEL);
|
||||
if (!resource)
|
||||
|
||||
Reference in New Issue
Block a user