summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/cmd_ubi.c2
-rw-r--r--drivers/mtd/nand/nand_util.c6
-rw-r--r--fs/ubifs/super.c4
-rw-r--r--fs/ubifs/ubifs.c4
-rw-r--r--lib/gzip.c2
5 files changed, 9 insertions, 9 deletions
diff --git a/common/cmd_ubi.c b/common/cmd_ubi.c
index cbc10c54947..30a125951c9 100644
--- a/common/cmd_ubi.c
+++ b/common/cmd_ubi.c
@@ -363,7 +363,7 @@ int ubi_volume_read(char *volume, char *buf, size_t size)
tbuf_size = vol->usable_leb_size;
if (size < tbuf_size)
tbuf_size = ALIGN(size, ubi->min_io_size);
- tbuf = malloc(tbuf_size);
+ tbuf = memalign(ARCH_DMA_MINALIGN, tbuf_size);
if (!tbuf) {
printf("NO MEM\n");
return ENOMEM;
diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
index 12dd26a33fa..395ba2d96ac 100644
--- a/drivers/mtd/nand/nand_util.c
+++ b/drivers/mtd/nand/nand_util.c
@@ -483,7 +483,7 @@ int nand_verify_page_oob(nand_info_t *nand, struct mtd_oob_ops *ops, loff_t ofs)
memcpy(&vops, ops, sizeof(vops));
- vops.datbuf = malloc(verlen);
+ vops.datbuf = memalign(ARCH_DMA_MINALIGN, verlen);
if (!vops.datbuf)
return -ENOMEM;
@@ -520,7 +520,7 @@ int nand_verify(nand_info_t *nand, loff_t ofs, size_t len, u_char *buf)
int rval = 0;
size_t verofs;
size_t verlen = nand->writesize;
- uint8_t *verbuf = malloc(verlen);
+ uint8_t *verbuf = memalign(ARCH_DMA_MINALIGN, verlen);
if (!verbuf)
return -ENOMEM;
@@ -839,7 +839,7 @@ int nand_torture(nand_info_t *nand, loff_t offset)
patt_count = ARRAY_SIZE(patterns);
- buf = malloc(nand->erasesize);
+ buf = memalign(ARCH_DMA_MINALIGN, nand->erasesize);
if (buf == NULL) {
puts("Out of memory for erase block buffer\n");
return -ENOMEM;
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 10f8fff0be6..ac0d13f86de 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -57,7 +57,7 @@ struct inode *iget_locked(struct super_block *sb, unsigned long ino)
{
struct inode *inode;
- inode = (struct inode *)malloc(sizeof(struct ubifs_inode));
+ inode = (struct inode *)memalign(ARCH_DMA_MINALIGN, sizeof(struct ubifs_inode));
if (inode) {
inode->i_ino = ino;
inode->i_sb = sb;
@@ -104,7 +104,7 @@ void iput(struct inode *inode)
/*
* Allocate and use new inode
*/
- ino = (struct inode *)malloc(sizeof(struct ubifs_inode));
+ ino = (struct inode *)memalign(ARCH_DMA_MINALIGN, sizeof(struct ubifs_inode));
memcpy(ino, inode, sizeof(struct ubifs_inode));
/*
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 6dd617426ad..03f9f790e36 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -108,7 +108,7 @@ static inline struct crypto_comp *crypto_alloc_comp(const char *alg_name,
struct crypto_comp *ptr;
int i = 0;
- ptr = malloc(sizeof(struct crypto_comp));
+ ptr = memalign(ARCH_DMA_MINALIGN, sizeof(struct crypto_comp));
while (i < UBIFS_COMPR_TYPES_CNT) {
comp = ubifs_compressors[i];
if (!comp) {
@@ -723,7 +723,7 @@ static int do_readpage(struct ubifs_info *c, struct inode *inode,
* destination area to a multiple of
* UBIFS_BLOCK_SIZE.
*/
- buff = malloc(UBIFS_BLOCK_SIZE);
+ buff = memalign(ARCH_DMA_MINALIGN, UBIFS_BLOCK_SIZE);
if (!buff) {
printf("%s: Error, malloc fails!\n",
__func__);
diff --git a/lib/gzip.c b/lib/gzip.c
index ff37d4f31be..2a74411c2ec 100644
--- a/lib/gzip.c
+++ b/lib/gzip.c
@@ -25,7 +25,7 @@ static void *zalloc(void *x, unsigned items, unsigned size)
size *= items;
size = (size + ZALLOC_ALIGNMENT - 1) & ~(ZALLOC_ALIGNMENT - 1);
- p = malloc (size);
+ p = memalign(ARCH_DMA_MINALIGN, size);
return (p);
}