mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-17 23:15:52 +00:00
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>
This commit is contained in:
parent
c7440a2f22
commit
305559f165
@ -259,7 +259,6 @@ static char *error_path(struct xenbus_device *dev)
|
|||||||
static void xenbus_va_dev_error(struct xenbus_device *dev, int err,
|
static void xenbus_va_dev_error(struct xenbus_device *dev, int err,
|
||||||
const char *fmt, va_list ap)
|
const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
char *printf_buffer = NULL;
|
char *printf_buffer = NULL;
|
||||||
char *path_buffer = NULL;
|
char *path_buffer = NULL;
|
||||||
@ -270,9 +269,7 @@ static void xenbus_va_dev_error(struct xenbus_device *dev, int err,
|
|||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
len = sprintf(printf_buffer, "%i ", -err);
|
len = sprintf(printf_buffer, "%i ", -err);
|
||||||
ret = vsnprintf(printf_buffer+len, PRINTF_BUFFER_SIZE-len, fmt, ap);
|
vsnprintf(printf_buffer+len, PRINTF_BUFFER_SIZE-len, fmt, ap);
|
||||||
|
|
||||||
BUG_ON(len + ret > PRINTF_BUFFER_SIZE-1);
|
|
||||||
|
|
||||||
dev_err(&dev->dev, "%s\n", printf_buffer);
|
dev_err(&dev->dev, "%s\n", printf_buffer);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user