diff options
author | NeilBrown <neilb@suse.de> | 2009-07-01 11:14:04 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-07-01 11:14:04 +1000 |
commit | b8d966efd9a46a9a35beac50cbff6e30565125ef (patch) | |
tree | d1c59125e8ee9677e8594bdc4ab223e692a87e50 | |
parent | 8f6c2e4b325a8e9f8f47febb2fd0ed4fae7d45a9 (diff) | |
download | kernel_samsung_crespo-b8d966efd9a46a9a35beac50cbff6e30565125ef.zip kernel_samsung_crespo-b8d966efd9a46a9a35beac50cbff6e30565125ef.tar.gz kernel_samsung_crespo-b8d966efd9a46a9a35beac50cbff6e30565125ef.tar.bz2 |
md: avoid dereferencing NULL pointer when accessing suspend_* sysfs attributes.
If we try to modify one of the md/ sysfs files
suspend_lo or suspend_hi
when the array is not active, we dereference a NULL.
Protect against that.
Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r-- | drivers/md/md.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 09be637..2166af8 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -3573,7 +3573,8 @@ suspend_lo_store(mddev_t *mddev, const char *buf, size_t len) char *e; unsigned long long new = simple_strtoull(buf, &e, 10); - if (mddev->pers->quiesce == NULL) + if (mddev->pers == NULL || + mddev->pers->quiesce == NULL) return -EINVAL; if (buf == e || (*e && *e != '\n')) return -EINVAL; @@ -3601,7 +3602,8 @@ suspend_hi_store(mddev_t *mddev, const char *buf, size_t len) char *e; unsigned long long new = simple_strtoull(buf, &e, 10); - if (mddev->pers->quiesce == NULL) + if (mddev->pers == NULL || + mddev->pers->quiesce == NULL) return -EINVAL; if (buf == e || (*e && *e != '\n')) return -EINVAL; |