From: Chen Gang Date: Fri, 26 Sep 2014 15:36:03 +0000 (+0800) Subject: xen/xenbus: Remove BUG_ON() when error string trucated X-Git-Tag: v3.18-rc1~89^2~1 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=305559f16538708b603ceeb317ebaed9c4da9ce9;p=uclinux-h8%2Flinux.git 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 Signed-off-by: David Vrabel --- 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);