diff options
author | Chen Gang <gang.chen.5i5j@gmail.com> | 2014-09-26 23:36:03 +0800 |
---|---|---|
committer | David Vrabel <david.vrabel@citrix.com> | 2014-10-06 10:27:56 +0100 |
commit | 305559f16538708b603ceeb317ebaed9c4da9ce9 (patch) | |
tree | 6b9e6ab3e351f865b817c296a25a9e19b56c69e4 /drivers/xen/xenbus/xenbus_client.c | |
parent | c7440a2f225e3b37abbe27f069465cd31ba94b3c (diff) | |
download | talos-op-linux-305559f16538708b603ceeb317ebaed9c4da9ce9.tar.gz talos-op-linux-305559f16538708b603ceeb317ebaed9c4da9ce9.zip |
xen/xenbus: Remove BUG_ON() when error string trucated
xenbus_va_dev_error() is for printing error, so when error string is
too long to be truncated, need not BUG_ON(), still return truncation
string is OK.
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'drivers/xen/xenbus/xenbus_client.c')
-rw-r--r-- | drivers/xen/xenbus/xenbus_client.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c index aa9b2fcdaeb2..ca744102b666 100644 --- a/drivers/xen/xenbus/xenbus_client.c +++ b/drivers/xen/xenbus/xenbus_client.c @@ -259,7 +259,6 @@ static char *error_path(struct xenbus_device *dev) static void xenbus_va_dev_error(struct xenbus_device *dev, int err, const char *fmt, va_list ap) { - int ret; unsigned int len; char *printf_buffer = NULL; char *path_buffer = NULL; @@ -270,9 +269,7 @@ static void xenbus_va_dev_error(struct xenbus_device *dev, int err, goto fail; len = sprintf(printf_buffer, "%i ", -err); - ret = vsnprintf(printf_buffer+len, PRINTF_BUFFER_SIZE-len, fmt, ap); - - BUG_ON(len + ret > PRINTF_BUFFER_SIZE-1); + vsnprintf(printf_buffer+len, PRINTF_BUFFER_SIZE-len, fmt, ap); dev_err(&dev->dev, "%s\n", printf_buffer); |