mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
md: don't return 0 from array_state_store
Returning zero from a 'store' function is bad.
The return value should be either len length of the string
or an error.
So use 'len' if 'err' is zero.
Fixes: 6791875e2e ("md: make reconfig_mutex optional for writes to md sysfs files.")
Signed-off-by: NeilBrown <[email protected]>
Cc: [email protected] (v4.0+)
This commit is contained in:
parent
c65b99f046
commit
c008f1d356
1 changed files with 1 additions and 1 deletions
|
|
@ -3834,7 +3834,7 @@ array_state_store(struct mddev *mddev, const char *buf, size_t len)
|
|||
err = -EBUSY;
|
||||
}
|
||||
spin_unlock(&mddev->lock);
|
||||
return err;
|
||||
return err ?: len;
|
||||
}
|
||||
err = mddev_lock(mddev);
|
||||
if (err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue