diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-06 16:40:47 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-06 16:40:47 +0000 |
commit | 4011b03fa6a6a7889efea3451a3a125faa72c7fc (patch) | |
tree | c6a1b2ba8ef824b137cd423a245a8cb1c35a0786 /nuttx/drivers/loop.c | |
parent | e888bb3a55e974475a87fee0371f4405ddab696e (diff) | |
download | px4-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/loop.c')
-rw-r--r-- | nuttx/drivers/loop.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/nuttx/drivers/loop.c b/nuttx/drivers/loop.c index dffa6e078..77cb9daf6 100644 --- a/nuttx/drivers/loop.c +++ b/nuttx/drivers/loop.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/loop.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 @@ -56,6 +56,7 @@ #include <debug.h> #include <errno.h> +#include <nuttx/kmalloc.h> #include <nuttx/fs.h> /**************************************************************************** @@ -377,7 +378,7 @@ int losetup(const char *devname, const char *filename, uint16_t sectsize, /* Allocate a loop device structure */ - dev = (FAR struct loop_struct_s *)zalloc(sizeof(struct loop_struct_s)); + dev = (FAR struct loop_struct_s *)kzalloc(sizeof(struct loop_struct_s)); if (!dev) { return -ENOMEM; @@ -437,7 +438,7 @@ int losetup(const char *devname, const char *filename, uint16_t sectsize, errout_with_fd: close(dev->fd); errout_with_dev: - free(dev); + kfree(dev); return ret; } @@ -500,6 +501,6 @@ int loteardown(const char *devname) (void)close(dev->fd); } - free(dev); + kfree(dev); return ret; } |