diff options
-rw-r--r-- | drivers/base/core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index aab43fbb8336..2b567177ef78 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -491,11 +491,13 @@ static int device_add_attrs(struct device *dev) | |||
491 | if (device_supports_offline(dev) && !dev->offline_disabled) { | 491 | if (device_supports_offline(dev) && !dev->offline_disabled) { |
492 | error = device_create_file(dev, &dev_attr_online); | 492 | error = device_create_file(dev, &dev_attr_online); |
493 | if (error) | 493 | if (error) |
494 | goto err_remove_type_groups; | 494 | goto err_remove_dev_groups; |
495 | } | 495 | } |
496 | 496 | ||
497 | return 0; | 497 | return 0; |
498 | 498 | ||
499 | err_remove_dev_groups: | ||
500 | device_remove_groups(dev, dev->groups); | ||
499 | err_remove_type_groups: | 501 | err_remove_type_groups: |
500 | if (type) | 502 | if (type) |
501 | device_remove_groups(dev, type->groups); | 503 | device_remove_groups(dev, type->groups); |