aboutsummaryrefslogtreecommitdiff
path: root/drivers/md/dm-emc.c
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2005-05-05 16:16:08 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-05 16:36:46 -0700
commitf1daa40b638891a62e1be40f78d752c500265362 (patch)
tree5d62da772240a6cb26eddee42c9bf0fc3ce703a3 /drivers/md/dm-emc.c
parentc557308e1f4b6f7d6144a06e8f98c467814f3aed (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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-emc.c b/drivers/md/dm-emc.c
index 70065866459..c7067674dcb 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)
{
struct emc_handler *h = kmalloc(sizeof(*h), GFP_KERNEL);
- if (h)
+ if (h) {
+ memset(h, 0, sizeof(*h));
spin_lock_init(&h->lock);
+ }
return h;
}
@@ -259,8 +261,6 @@ static int emc_create(struct hw_handler *hwh, unsigned argc, char **argv)
if (!h)
return -ENOMEM;
- memset(h, 0, sizeof(*h));
-
hwh->context = h;
if ((h->short_trespass = short_trespass))