staging: ion: Prevent incorrect reference counting behavour
Subsystems (2)
PATCH v3 1/1 staging: ion: Prevent incorrect reference counting behavour
Supply additional checks in order to prevent unexpected results.
Fixes b892bf75b2034 ("ion: Switch ion to use dma-buf")
Suggested-by Dan Carpenter <[email protected]>
Signed-off-by Lee Jones <[email protected]>
---
Destined for v4.4.y and v4.9.y
drivers/staging/android/ion/ion.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/staging/android/ion/ion.c +6 -0
@@ -489,6 +489,9 @@ static void *ion_buffer_kmap_get(struct ion_buffer *buffer)void *vaddr;if (buffer->kmap_cnt) { +if (buffer->kmap_cnt ==INT_MAX ) +return ERR_PTR (-EOVERFLOW ); + buffer->kmap_cnt++;return buffer->vaddr; }
@@ -509,6 +512,9 @@ static void *ion_handle_kmap_get(struct ion_handle *handle)void *vaddr;if (handle->kmap_cnt) { +if (handle->kmap_cnt ==INT_MAX ) +return ERR_PTR (-EOVERFLOW ); + handle->kmap_cnt++;return buffer->vaddr; }
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
Quoted 7 lines · Lee Jones
Supply additional checks in order to prevent unexpected results.
Fixes b892bf75b2034 ("ion: Switch ion to use dma-buf")Suggested-by Dan Carpenter <[email protected]>Signed-off-by Lee Jones <[email protected]>---
Destined for v4.4.y and v4.9.y
Thanks!
regards,
dan carpenter
Greg KH
maintainerQuoted 10 lines · Lee Jones
Supply additional checks in order to prevent unexpected results.
Fixes b892bf75b2034 ("ion: Switch ion to use dma-buf")Suggested-by Dan Carpenter <[email protected]>Signed-off-by Lee Jones <[email protected]>---
Destined for v4.4.y and v4.9.ydrivers/staging/android/ion/ion.c | 6 ++++++ 1 file changed, 6 insertions(+)
Now queued up, thanks.
greg k-h