Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140175
b: refs/heads/master
c: a32079c
h: refs/heads/master
i:
  140173: 4bdc4a4
  140171: 17f160c
  140167: 5cf0b11
  140159: 8e05783
v: v3
  • Loading branch information
Jonathan Brassow authored and Alasdair G Kergon committed Apr 2, 2009
1 parent 800e64b commit 1602fcd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1e302a929e2da6e8448e2058e4b07b07252b57fe
refs/heads/master: a32079ce17899192a7b98a42753be467605a8b2f
20 changes: 15 additions & 5 deletions trunk/drivers/md/dm-snap-persistent.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,12 @@ static int alloc_area(struct pstore *ps)

static void free_area(struct pstore *ps)
{
vfree(ps->area);
if (ps->area)
vfree(ps->area);
ps->area = NULL;
vfree(ps->zero_area);

if (ps->zero_area)
vfree(ps->zero_area);
ps->zero_area = NULL;
}

Expand Down Expand Up @@ -482,9 +485,16 @@ static void persistent_dtr(struct dm_exception_store *store)
struct pstore *ps = get_info(store);

destroy_workqueue(ps->metadata_wq);
dm_io_client_destroy(ps->io_client);
vfree(ps->callbacks);

/* Created in read_header */
if (ps->io_client)
dm_io_client_destroy(ps->io_client);
free_area(ps);

/* Allocated in persistent_read_metadata */
if (ps->callbacks)
vfree(ps->callbacks);

kfree(ps);
}

Expand Down Expand Up @@ -661,7 +671,7 @@ static int persistent_ctr(struct dm_exception_store *store,
struct pstore *ps;

/* allocate the pstore */
ps = kmalloc(sizeof(*ps), GFP_KERNEL);
ps = kzalloc(sizeof(*ps), GFP_KERNEL);
if (!ps)
return -ENOMEM;

Expand Down

0 comments on commit 1602fcd

Please sign in to comment.