summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Peiffer <pierre.peiffer@stericsson.com>2011-07-11 11:05:42 +0200
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:06:56 +0200
commit0f47c95922e04bf0611ae81f24da470affd7d8cc (patch)
treeeeb75561f698a3b2dddf9a39fac11927973dd8ec
parent6ff360b7b070fa5bbcf8bada29c8aeca0da8dc04 (diff)
u8500 CM: use vmalloc() for big allocations
Use vmalloc() instead of OSAL_Alloc() for "big" allocations. OSAL_Alloc() uses kmalloc by default and default to vmalloc() if kmalloc() fails. The logic works, but an ugly print appears in the console each time kmalloc() fails. We use now directly vmalloc() to avoid these ugly prints ST-Ericsson Linux next: - ST-Ericsson ID: 343810 ST-Ericsson FOSS-OUT ID: Trivial Signed-off-by: Pierre Peiffer <pierre.peiffer@stericsson.com>
-rw-r--r--drivers/staging/nmf-cm/cm_syscall.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/nmf-cm/cm_syscall.c b/drivers/staging/nmf-cm/cm_syscall.c
index 70f73e8ad97..0d1bf8ffe4e 100644
--- a/drivers/staging/nmf-cm/cm_syscall.c
+++ b/drivers/staging/nmf-cm/cm_syscall.c
@@ -7,6 +7,7 @@
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
+#include <linux/vmalloc.h>
#include <cm/engine/api/cm_engine.h>
#include "cmioctl.h"
#include "osal-kernel.h"
@@ -65,7 +66,7 @@ inline int cmld_InstantiateComponent(struct cm_process_priv* procPriv,
return -EFAULT;
if (data.in.dataFile != NULL) {
- dataFile = OSAL_Alloc(data.in.dataFileSize);
+ dataFile = vmalloc(data.in.dataFileSize);
if (dataFile == NULL) {
data.out.error = CM_NO_MORE_MEMORY;
goto out;
@@ -99,7 +100,7 @@ inline int cmld_InstantiateComponent(struct cm_process_priv* procPriv,
out:
if (dataFile)
- OSAL_Free(dataFile);
+ vfree(dataFile);
/* Copy results back to userspace */
if (copy_to_user(&param->out, &data.out, sizeof(data.out)))
return -EFAULT;