RE: [PATCH 2/9] dma-buf: make to_dma_fence_array NULL safe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>-----Original Message-----
>From: dri-devel [mailto:dri-devel-bounces@xxxxxxxxxxxxxxxxxxxxx] On Behalf
>Of Christian König
>Sent: Monday, August 26, 2019 10:57 AM
>To: dri-devel@xxxxxxxxxxxxxxxxxxxxx; chris@xxxxxxxxxxxxxxxxxx;
>daniel.vetter@xxxxxxxx; sumit.semwal@xxxxxxxxxx; linux-
>media@xxxxxxxxxxxxxxx; linaro-mm-sig@xxxxxxxxxxxxxxxx
>Subject: [PATCH 2/9] dma-buf: make to_dma_fence_array NULL safe
>
>A bit surprising that this wasn't already the case.
>
>Signed-off-by: Christian König <christian.koenig@xxxxxxx>
>---
> include/linux/dma-fence-array.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/include/linux/dma-fence-array.h b/include/linux/dma-fence-
>array.h
>index 303dd712220f..f99cd7eb24e0 100644
>--- a/include/linux/dma-fence-array.h
>+++ b/include/linux/dma-fence-array.h
>@@ -68,7 +68,7 @@ static inline bool dma_fence_is_array(struct dma_fence
>*fence)
> static inline struct dma_fence_array *
> to_dma_fence_array(struct dma_fence *fence)
> {
>-	if (fence->ops != &dma_fence_array_ops)
>+	if (!fence || fence->ops != &dma_fence_array_ops)
> 		return NULL;
>
> 	return container_of(fence, struct dma_fence_array, base);

It looks like dma_fence_is_array() has the same issue.

Is it worth fixing?

Mike


>--
>2.17.1
>
>_______________________________________________
>dri-devel mailing list
>dri-devel@xxxxxxxxxxxxxxxxxxxxx
>https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux