]> git.baikalelectronics.ru Git - kernel.git/commit
driver core: Prevent warning when removing a device link from unregistered consumer
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 16 Jul 2021 11:44:07 +0000 (14:44 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Jul 2021 15:28:42 +0000 (17:28 +0200)
commit73a8b8950266bc510ff494c1cfba109693c24e43
tree249022dd106d11ae5b031ebf19361479e1b9ef22
parentbde86e15e247714a7f8b3d759ac8b608868f8a43
driver core: Prevent warning when removing a device link from unregistered consumer

sysfs_remove_link() causes a warning if the parent directory does not
exist. That can happen if the device link consumer has not been registered.
So do not attempt sysfs_remove_link() in that case.

Fixes: 18c09e885bcb3 ("driver core: Expose device link details in sysfs")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: stable@vger.kernel.org # 5.9+
Reviewed-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20210716114408.17320-2-adrian.hunter@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/core.c