MMCSD: Use cache aligned alloc for ioctl

Some drivers can't easily work with buffers that are not cache aligned
and have an arbitrary length. Therefore use an aligned malloc instead.
This commit is contained in:
Christian Mauderer 2021-04-13 13:55:11 +02:00
parent 9b9a976847
commit 8aa3ddfbd7

View File

@ -1196,7 +1196,11 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_ioc_cmd *mic, int fflag)
goto out;
}
if (len != 0) {
#ifndef __rtems__
dp = malloc(len, M_TEMP, M_WAITOK);
#else /* __rtems__ */
dp = rtems_cache_aligned_malloc(len);
#endif /* __rtems__ */
err = copyin((void *)(uintptr_t)mic->data_ptr, dp, len);
if (err != 0)
goto out;