diff options
| -rw-r--r-- | drivers/base/memory.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 9e59f6535c44..bece691cb5d9 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c | |||
| @@ -333,8 +333,10 @@ store_mem_state(struct device *dev, | |||
| 333 | online_type = ONLINE_KEEP; | 333 | online_type = ONLINE_KEEP; |
| 334 | else if (!strncmp(buf, "offline", min_t(int, count, 7))) | 334 | else if (!strncmp(buf, "offline", min_t(int, count, 7))) |
| 335 | online_type = -1; | 335 | online_type = -1; |
| 336 | else | 336 | else { |
| 337 | return -EINVAL; | 337 | ret = -EINVAL; |
| 338 | goto err; | ||
| 339 | } | ||
| 338 | 340 | ||
| 339 | switch (online_type) { | 341 | switch (online_type) { |
| 340 | case ONLINE_KERNEL: | 342 | case ONLINE_KERNEL: |
| @@ -357,6 +359,7 @@ store_mem_state(struct device *dev, | |||
| 357 | ret = -EINVAL; /* should never happen */ | 359 | ret = -EINVAL; /* should never happen */ |
| 358 | } | 360 | } |
| 359 | 361 | ||
| 362 | err: | ||
| 360 | unlock_device_hotplug(); | 363 | unlock_device_hotplug(); |
| 361 | 364 | ||
| 362 | if (ret) | 365 | if (ret) |
