summaryrefslogtreecommitdiffstats
path: root/sys/ofed/include/linux/linux_compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/ofed/include/linux/linux_compat.c')
-rw-r--r--sys/ofed/include/linux/linux_compat.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/ofed/include/linux/linux_compat.c b/sys/ofed/include/linux/linux_compat.c
index cc7be3d..1acf08e 100644
--- a/sys/ofed/include/linux/linux_compat.c
+++ b/sys/ofed/include/linux/linux_compat.c
@@ -715,6 +715,23 @@ vunmap(void *addr)
kfree(vmmap);
}
+char *
+kvasprintf(gfp_t gfp, const char *fmt, va_list ap)
+{
+ unsigned int len;
+ char *p;
+ va_list aq;
+
+ va_copy(aq, ap);
+ len = vsnprintf(NULL, 0, fmt, aq);
+ va_end(aq);
+
+ p = kmalloc(len + 1, gfp);
+ if (p != NULL)
+ vsnprintf(p, len + 1, fmt, ap);
+
+ return (p);
+}
char *
kasprintf(gfp_t gfp, const char *fmt, ...)
@@ -726,7 +743,7 @@ kasprintf(gfp_t gfp, const char *fmt, ...)
p = kvasprintf(gfp, fmt, ap);
va_end(ap);
- return p;
+ return (p);
}
static int
OpenPOWER on IntegriCloud