summaryrefslogtreecommitdiff
path: root/nuttx/drivers/bch/bchlib_setup.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-06 16:40:47 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-06 16:40:47 +0000
commit4011b03fa6a6a7889efea3451a3a125faa72c7fc (patch)
treec6a1b2ba8ef824b137cd423a245a8cb1c35a0786 /nuttx/drivers/bch/bchlib_setup.c
parente888bb3a55e974475a87fee0371f4405ddab696e (diff)
downloadpx4-nuttx-4011b03fa6a6a7889efea3451a3a125faa72c7fc.tar.gz
px4-nuttx-4011b03fa6a6a7889efea3451a3a125faa72c7fc.tar.bz2
px4-nuttx-4011b03fa6a6a7889efea3451a3a125faa72c7fc.zip
Fixes for kernel stub builds
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3473 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/bch/bchlib_setup.c')
-rw-r--r--nuttx/drivers/bch/bchlib_setup.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/nuttx/drivers/bch/bchlib_setup.c b/nuttx/drivers/bch/bchlib_setup.c
index f0ce24dae..b97b63dd2 100644
--- a/nuttx/drivers/bch/bchlib_setup.c
+++ b/nuttx/drivers/bch/bchlib_setup.c
@@ -1,7 +1,7 @@
/****************************************************************************
* drivers/bch/bchlib_setup.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -49,6 +49,7 @@
#include <assert.h>
#include <debug.h>
+#include <nuttx/kmalloc.h>
#include <nuttx/fs.h>
#include "bch_internal.h"
@@ -92,7 +93,7 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle)
/* Allocate the BCH state structure */
- bch = (FAR struct bchlib_s*)zalloc(sizeof(struct bchlib_s));
+ bch = (FAR struct bchlib_s*)kzalloc(sizeof(struct bchlib_s));
if (!bch)
{
fdbg("Failed to allocate BCH structure\n");
@@ -141,7 +142,7 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle)
/* Allocate the sector I/O buffer */
- bch->buffer = (FAR uint8_t *)malloc(bch->sectsize);
+ bch->buffer = (FAR uint8_t *)kmalloc(bch->sectsize);
if (!bch->buffer)
{
fdbg("Failed to allocate sector buffer\n");
@@ -153,6 +154,6 @@ int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle)
return OK;
errout_with_bch:
- free(bch);
+ kfree(bch);
return ret;
}