linux-stable/drivers/dma-buf
Dan Carpenter c3d576baa6 dma-buf: fix an error pointer vs NULL bug
commit 00ae1491f9 upstream.

Smatch detected potential error pointer dereference.

    drivers/gpu/drm/drm_syncobj.c:888 drm_syncobj_transfer_to_timeline()
    error: 'fence' dereferencing possible ERR_PTR()

The error pointer comes from dma_fence_allocate_private_stub().  One
caller expected error pointers and one expected NULL pointers.  Change
it to return NULL and update the caller which expected error pointers,
drm_syncobj_assign_null_handle(), to check for NULL instead.

Fixes: f781f661e8 ("dma-buf: keep the signaling time of merged fences v3")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/b09f1996-3838-4fa2-9193-832b68262e43@moroto.mountain
Cc: Jindong Yue <jindong.yue@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-03 10:24:19 +02:00
..
heaps dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
dma-buf-sysfs-stats.c dma-buf: fix dma_buf_export init order v2 2023-01-24 07:24:30 +01:00
dma-buf-sysfs-stats.h dma-buf: fix dma_buf_export init order v2 2023-01-24 07:24:30 +01:00
dma-buf.c dma-buf: fix dma_buf_export init order v2 2023-01-24 07:24:30 +01:00
dma-fence-array.c dma-buf: handle empty dma_fence_arrays gracefully 2022-03-29 09:14:30 +02:00
dma-fence-chain.c dma-buf: cleanup dma_fence_chain_walk 2022-05-30 11:24:50 +02:00
dma-fence-unwrap.c dma-buf: keep the signaling time of merged fences v3 2023-08-03 10:24:19 +02:00
dma-fence.c dma-buf: fix an error pointer vs NULL bug 2023-08-03 10:24:19 +02:00
dma-heap.c dma-buf: fix racing conflict of dma_heap_add() 2022-11-22 18:27:56 +05:30
dma-resv.c dma-buf/dma-resv: Stop leaking on krealloc() failure 2023-07-27 08:50:27 +02:00
Kconfig dma-buf: deprecate DMABUF_SYSFS_STATS 2022-06-23 10:51:43 +02:00
Makefile dma-buf: cleanup dma_fence_unwrap implementation 2022-05-30 14:16:32 +02:00
selftest.c
selftest.h
selftests.h dma-buf: add dma_fence_unwrap v2 2022-03-25 14:18:28 +01:00
st-dma-fence-chain.c dma-buf: Enable signaling on fence for selftests 2022-09-16 15:53:25 +02:00
st-dma-fence-unwrap.c dma-buf: Enable signaling on fence for selftests 2022-09-16 15:53:25 +02:00
st-dma-fence.c dma-buf: Enable signaling on fence for selftests 2022-09-16 15:53:25 +02:00
st-dma-resv.c dma-buf: Enable signaling on fence for selftests 2022-09-16 15:53:25 +02:00
sw_sync.c
sync_debug.c
sync_debug.h
sync_file.c dma-buf/sync_file: use strscpy to replace strlcpy 2022-08-10 13:50:49 +02:00
sync_trace.h
udmabuf.c whack-a-mole: cropped up open-coded file_inode() uses... 2022-10-06 17:22:11 -07:00