Skip to content

Commit

Permalink
rbd: cleanup: make kfree match kmalloc
Browse files Browse the repository at this point in the history
Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Sage Weil committed May 24, 2011
1 parent 13143d2 commit 916d4d6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@ static int rbd_header_add_snap(struct rbd_device *dev,
int name_len = strlen(snap_name);
u64 new_snapid;
int ret;
void *data, *data_start, *data_end;
void *data, *p, *e;
u64 ver;

/* we should create a snapshot only if we're pointing at the head */
Expand All @@ -1619,16 +1619,16 @@ static int rbd_header_add_snap(struct rbd_device *dev,
if (!data)
return -ENOMEM;

data_start = data;
data_end = data + name_len + 16;
p = data;
e = data + name_len + 16;

ceph_encode_string_safe(&data, data_end, snap_name, name_len, bad);
ceph_encode_64_safe(&data, data_end, new_snapid, bad);
ceph_encode_string_safe(&p, e, snap_name, name_len, bad);
ceph_encode_64_safe(&p, e, new_snapid, bad);

ret = rbd_req_sync_exec(dev, dev->obj_md_name, "rbd", "snap_add",
data_start, data - data_start, &ver);
data, p - data, &ver);

kfree(data_start);
kfree(data);

if (ret < 0)
return ret;
Expand Down

0 comments on commit 916d4d6

Please sign in to comment.