The callback function dma_buf_describe() returns an int not void so the
function pointer cast in dma_buf_show() is wrong. dma_buf_describe() can
also fail when acquiring the mutex gets interrupted so always returning
0 in dma_buf_show() is wrong, too.

Fix both issues by casting the function pointer to the correct type and
propagate its return value.

This type mismatch was caught by the PaX RAP plugin.

Signed-off-by: Mathias Krause <mini...@googlemail.com>
Cc: Sumit Semwal <sumit.sem...@linaro.org>
Cc: Daniel Vetter <daniel.vet...@ffwll.ch>
Cc: PaX Team <pagee...@freemail.hu>
---
 drivers/dma-buf/dma-buf.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index 6355ab38d630..0f2a4592fdd2 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -881,10 +881,9 @@ static int dma_buf_describe(struct seq_file *s)
 
 static int dma_buf_show(struct seq_file *s, void *unused)
 {
-       void (*func)(struct seq_file *) = s->private;
+       int (*func)(struct seq_file *) = s->private;
 
-       func(s);
-       return 0;
+       return func(s);
 }
 
 static int dma_buf_debug_open(struct inode *inode, struct file *file)
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to