[PATCH] mtd: gpmi: Fix NULL pointer dereference

Brian Norris computersforpeace at gmail.com
Mon Nov 11 21:56:18 EST 2013


On Mon, Nov 11, 2013 at 6:47 PM, Huang Shijie <b32955 at freescale.com> wrote:
> 于 2013年11月12日 02:23, Brian Norris 写道:
>> (2) The second switched the whole NAND buffer over to a kzalloc'd
>>     buffer, with NAND_OWN_BUFFERS. I'm not a huge fan of
>>     NAND_OWN_BUFFERS, and I think drivers should only be using it if
>>     they really need it, for special buffer placement or some other good
>>     reason. You just happen to need a buffer "too early", where you can
>>     really just allocate a small temporary buffer.
> why I use the NAND_OWN_BUFFERS? just for a small temporary buffer?
> the answer is no.
>
> For imx23, the work flow is like this:
> [1] first check the fingerprint, if we can find it, we will return
> immediately.
> [2] if [1] failed, such as you erase all the partitions, the gpmi will call
> mx23_write_transcription_stamp() to write the fingerprint.
>
> So the @chip->buffer is not only used by the
> mx23_check_transcription_stamp(),
> but _also_ used by the mx23_write_transcription_stamp() when the gpmi
> can not find any
> fingerprint in the NAND page.

Right, thanks for pointing this out.

> That's why i use the NAND_OWN_BUFFERS, the buffer can be used by both
> the mx23_check_transcription_stamp()
> and mx23_write_transcription_stamp().

I will resume discussion on your NAND_OWN_BUFFERS patch.

Brian



More information about the linux-mtd mailing list