Re: [patch 3/6] [RFC] Add MMC Password Protection (lock/unlock) support V5

David Brownell
2006-10-30T03:07:10Z

On Sunday 29 October 2006 1:49 am, Pierre Ossman wrote:

> > + data_buf = kmalloc(data_size, GFP_KERNEL);
> >
>
> For something that can be at most 34 bytes, a kmalloc seems excessive.
> Put it on the stack. Just remember to have checks so we do not overflow.

It does seem excessive, but stack-allocated buffers are not guaranteed
to be DMA-safe. See Documentation/DMA-mapping.txt right in the first
major section "What memory is DMA'able?"...