1 From 4542b5d7b4e00b11dd37d93986b624c58b198765 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Mon, 7 Oct 2019 14:02:57 +0100
4 Subject: [PATCH] staging: bcm2835-codec: Fix imbalance in
5 dma_buf_get/dma_buf_put
7 When represented with a dmabuf buffer that had previously been
8 imported, there was a call to dma_buf_get without a matching
9 dma_buf_put. This left dmabufs in limbo after all users had
10 supposedly released them.
12 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
14 .../staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c | 5 +++++
15 1 file changed, 5 insertions(+)
17 --- a/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
18 +++ b/drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c
19 @@ -2112,6 +2112,11 @@ static int bcm2835_codec_buf_prepare(str
22 buf->mmal.dma_buf = dma_buf;
24 + /* We already have a reference count on the dmabuf, so
25 + * release the one we acquired above.
27 + dma_buf_put(dma_buf);