diff options
author | Alasdair G Kergon <agk@redhat.com> | 2005-05-05 19:16:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-05 19:36:46 -0400 |
commit | f1daa40b638891a62e1be40f78d752c500265362 (patch) | |
tree | 5d62da772240a6cb26eddee42c9bf0fc3ce703a3 /drivers/md/dm-emc.c | |
parent | c557308e1f4b6f7d6144a06e8f98c467814f3aed (diff) |
[PATCH] device-mapper dm-emc: Fix a memset
The dm emc hardware handler code memset the hardware handler structure to zero
AFTER it had initialized the structure's spinlock field.
Signed-Off-By: Alasdair G Kergon <agk@redhat.com>
From: Dave Olien <dmo@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/dm-emc.c')
-rw-r--r-- | drivers/md/dm-emc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-emc.c b/drivers/md/dm-emc.c index 700658664594..c7067674dcb7 100644 --- a/drivers/md/dm-emc.c +++ b/drivers/md/dm-emc.c | |||
@@ -223,8 +223,10 @@ static struct emc_handler *alloc_emc_handler(void) | |||
223 | { | 223 | { |
224 | struct emc_handler *h = kmalloc(sizeof(*h), GFP_KERNEL); | 224 | struct emc_handler *h = kmalloc(sizeof(*h), GFP_KERNEL); |
225 | 225 | ||
226 | if (h) | 226 | if (h) { |
227 | memset(h, 0, sizeof(*h)); | ||
227 | spin_lock_init(&h->lock); | 228 | spin_lock_init(&h->lock); |
229 | } | ||
228 | 230 | ||
229 | return h; | 231 | return h; |
230 | } | 232 | } |
@@ -259,8 +261,6 @@ static int emc_create(struct hw_handler *hwh, unsigned argc, char **argv) | |||
259 | if (!h) | 261 | if (!h) |
260 | return -ENOMEM; | 262 | return -ENOMEM; |
261 | 263 | ||
262 | memset(h, 0, sizeof(*h)); | ||
263 | |||
264 | hwh->context = h; | 264 | hwh->context = h; |
265 | 265 | ||
266 | if ((h->short_trespass = short_trespass)) | 266 | if ((h->short_trespass = short_trespass)) |