mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
[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>
This commit is contained in:
parent
c557308e1f
commit
f1daa40b63
1 changed files with 3 additions and 3 deletions
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue