Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dma-direct: check return value when encrypting or decrypting memory
__change_page_attr() can fail which will cause set_memory_encrypted() and set_memory_decrypted() to return non-zero. If the device requires unencrypted DMA memory and decryption fails, simply free the memory and fail. If attempting to re-encrypt in the failure path and that encryption fails, there is no alternative other than to leak the memory. Fixes: c10f07a ("dma/direct: Handle force decryption for DMA coherent buffers in common code") Signed-off-by: David Rientjes <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
- Loading branch information