Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282102
b: refs/heads/master
c: a800651
h: refs/heads/master
v: v3
  • Loading branch information
Ian Campbell authored and Konrad Rzeszutek Wilk committed Jan 4, 2012
1 parent 8260839 commit 80ed333
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 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: 50bf73796e85ed6a061df6d8474f7cef7870df6a
refs/heads/master: a800651e8893007d3a12bc281f0265f18043c4fa
17 changes: 7 additions & 10 deletions trunk/drivers/xen/xenbus/xenbus_xs.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,21 +532,18 @@ int xenbus_printf(struct xenbus_transaction t,
{
va_list ap;
int ret;
#define PRINTF_BUFFER_SIZE 4096
char *printf_buffer;

printf_buffer = kmalloc(PRINTF_BUFFER_SIZE, GFP_NOIO | __GFP_HIGH);
if (printf_buffer == NULL)
return -ENOMEM;
char *buf;

va_start(ap, fmt);
ret = vsnprintf(printf_buffer, PRINTF_BUFFER_SIZE, fmt, ap);
buf = kvasprintf(GFP_NOIO | __GFP_HIGH, fmt, ap);
va_end(ap);

BUG_ON(ret > PRINTF_BUFFER_SIZE-1);
ret = xenbus_write(t, dir, node, printf_buffer);
if (!buf)
return -ENOMEM;

ret = xenbus_write(t, dir, node, buf);

kfree(printf_buffer);
kfree(buf);

return ret;
}
Expand Down

0 comments on commit 80ed333

Please sign in to comment.