<p dir="ltr"><br>
On Mar 11, 2014 7:57 AM, "Matt Davis" <<a href="mailto:mattdavis9@gmail.com">mattdavis9@gmail.com</a>> wrote:<br>
><br>
> I have a kernel module that communicates to a PCI device via DMA. The<br>
> module allocates the shared memory using dma_alloc_coherent(). When<br>
> the module is unloaded, a call to dma_free_coherent() is executed.<br>
><br>
> My question is, since the DMA memory is not explicitly zeroed before<br>
> deallocation, is there a chance that the PCI device could still read<br>
> (non-zeroed data) and act upon the DMA memory after the module unloads<br>
> and calls dma_free_coherent()?<br>
><br>
Ideally you should stop the device before freeing the memory.<br>
If device is allowed to run and access the memory after memory is free this may leads to memory coruption that would be hard to debug.</p>
<p dir="ltr">> Thanks!<br>
><br>
> -Matt<br>
><br>
><br>
-Chetan _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</p>