Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359567
b: refs/heads/master
c: 4caf35f
h: refs/heads/master
i:
  359565: 8bb5572
  359563: d41a445
  359559: e9f7512
  359551: 3d99242
v: v3
  • Loading branch information
Alex Elder authored and Alex Elder committed Jan 17, 2013
1 parent 1cc5872 commit bcd50d5
Show file tree
Hide file tree
Showing 2 changed files with 3 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: 979ed480a2722ad8d9f87054635158f652a1241e
refs/heads/master: 4caf35f9ecdca1feef1d2e5e223b78e52ffbea87
7 changes: 2 additions & 5 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3151,11 +3151,9 @@ static inline char *dup_token(const char **buf, size_t *lenp)
size_t len;

len = next_token(buf);
dup = kmalloc(len + 1, GFP_KERNEL);
dup = kmemdup(*buf, len + 1, GFP_KERNEL);
if (!dup)
return NULL;

memcpy(dup, *buf, len);
*(dup + len) = '\0';
*buf += len;

Expand Down Expand Up @@ -3264,10 +3262,9 @@ static int rbd_add_parse_args(const char *buf,
ret = -ENAMETOOLONG;
goto out_err;
}
spec->snap_name = kmalloc(len + 1, GFP_KERNEL);
spec->snap_name = kmemdup(buf, len + 1, GFP_KERNEL);
if (!spec->snap_name)
goto out_mem;
memcpy(spec->snap_name, buf, len);
*(spec->snap_name + len) = '\0';

/* Initialize all rbd options to the defaults */
Expand Down

0 comments on commit bcd50d5

Please sign in to comment.