Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118122
b: refs/heads/master
c: 60c856c
h: refs/heads/master
v: v3
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Oct 30, 2008
1 parent 6807a55 commit 8405ff6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 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: b34578a48459ed1bd5396631aaa4a65d6bcc7726
refs/heads/master: 60c856c8e2f57a3f69c505735ef66e3719ea0bd6
16 changes: 9 additions & 7 deletions trunk/drivers/md/dm-snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,19 +229,21 @@ static void __insert_origin(struct origin *o)
*/
static int register_snapshot(struct dm_snapshot *snap)
{
struct origin *o;
struct origin *o, *new_o;
struct block_device *bdev = snap->origin->bdev;

new_o = kmalloc(sizeof(*new_o), GFP_KERNEL);
if (!new_o)
return -ENOMEM;

down_write(&_origins_lock);
o = __lookup_origin(bdev);

if (!o) {
if (o)
kfree(new_o);
else {
/* New origin */
o = kmalloc(sizeof(*o), GFP_KERNEL);
if (!o) {
up_write(&_origins_lock);
return -ENOMEM;
}
o = new_o;

/* Initialise the struct */
INIT_LIST_HEAD(&o->snapshots);
Expand Down

0 comments on commit 8405ff6

Please sign in to comment.