diff options
author | NeilBrown <neilb@suse.de> | 2011-07-27 17:56:24 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-07-27 17:56:24 -0400 |
commit | a519b26dbe6533416d21b552053b0bf687f878d7 (patch) | |
tree | bef24eab8604ef2275eb8f1b591ea52bd4b89194 /drivers/md/md.c | |
parent | 768e587e18c1c4ce0403b9532115752189422408 (diff) |
md: remove suspicious size_of()
When calling bioset_create we pass the size of the front_pad as
sizeof(mddev)
which looks suspicious as mddev is a pointer and so it looks like a
common mistake where
sizeof(*mddev)
was intended.
The size is actually correct as we want to store a pointer in the
front padding of the bios created by the bioset, so make the intent
more explicit by using
sizeof(mddev_t *)
Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 7caa096d02f6..4279b3b58d1a 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -4497,7 +4497,8 @@ int md_run(mddev_t *mddev) | |||
4497 | } | 4497 | } |
4498 | 4498 | ||
4499 | if (mddev->bio_set == NULL) | 4499 | if (mddev->bio_set == NULL) |
4500 | mddev->bio_set = bioset_create(BIO_POOL_SIZE, sizeof(mddev)); | 4500 | mddev->bio_set = bioset_create(BIO_POOL_SIZE, |
4501 | sizeof(mddev_t *)); | ||
4501 | 4502 | ||
4502 | spin_lock(&pers_lock); | 4503 | spin_lock(&pers_lock); |
4503 | pers = find_pers(mddev->level, mddev->clevel); | 4504 | pers = find_pers(mddev->level, mddev->clevel); |