From: Rob Clark Date: Fri, 28 Sep 2012 07:29:43 +0000 (+0200) Subject: dma-buf: might_sleep() in dma_buf_unmap_attachment() X-Git-Tag: v3.8-rc1~34^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b6fa0cd62c5b9d47f8e5d42cb2876677a5ed701e;p=karo-tx-linux.git dma-buf: might_sleep() in dma_buf_unmap_attachment() We never really clarified if unmap could be done in atomic context. But since mapping might require sleeping, this implies mutex in use to synchronize mapping/unmapping, so unmap could sleep as well. Add a might_sleep() to clarify this. Signed-off-by: Rob Clark Acked-by: Daniel Vetter Reviewed-by: Maarten Lankhorst Signed-off-by: Sumit Semwal --- diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c index 460e22dee36d..a3f79c495a41 100644 --- a/drivers/base/dma-buf.c +++ b/drivers/base/dma-buf.c @@ -298,6 +298,8 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach, struct sg_table *sg_table, enum dma_data_direction direction) { + might_sleep(); + if (WARN_ON(!attach || !attach->dmabuf || !sg_table)) return;