linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fence: checking for NULL pointer after dereferencing it.
@ 2019-08-06 18:04 Xinpeng Liu
  0 siblings, 0 replies; only message in thread
From: Xinpeng Liu @ 2019-08-06 18:04 UTC (permalink / raw)
  To: sumit.semwal, gustavo
  Cc: linux-media, dri-devel, linaro-mm-sig, linux-kernel, Xinpeng Liu

drivers/dma-buf/dma-fence.c:131 in function dma_fence_signal_locked,
if (WARN_ON(!fence)) should be before lockdep_assert_held(fence->lock);
otherwise there is not any meaning.

Signed-off-by: Xinpeng Liu <danielliu861@gmail.com>
---
 drivers/dma-buf/dma-fence.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 59ac96e..0b11063 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -131,10 +131,9 @@ int dma_fence_signal_locked(struct dma_fence *fence)
 	struct dma_fence_cb *cur, *tmp;
 	int ret = 0;
 
-	lockdep_assert_held(fence->lock);
-
 	if (WARN_ON(!fence))
 		return -EINVAL;
+	lockdep_assert_held(fence->lock);
 
 	if (test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) {
 		ret = -EINVAL;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-06 18:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-06 18:04 [PATCH] fence: checking for NULL pointer after dereferencing it Xinpeng Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).