Skip to content

Commit 2c9739d

Browse files
6by9popcornmix
authored andcommitted
staging: bcm2835-codec: Fix imbalance in dma_buf_get/dma_buf_put
When represented with a dmabuf buffer that had previously been imported, there was a call to dma_buf_get without a matching dma_buf_put. This left dmabufs in limbo after all users had supposedly released them. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
1 parent 8e41202 commit 2c9739d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,6 +2112,11 @@ static int bcm2835_codec_buf_prepare(struct vb2_buffer *vb)
21122112
}
21132113

21142114
buf->mmal.dma_buf = dma_buf;
2115+
} else {
2116+
/* We already have a reference count on the dmabuf, so
2117+
* release the one we acquired above.
2118+
*/
2119+
dma_buf_put(dma_buf);
21152120
}
21162121
ret = 0;
21172122
break;

0 commit comments

Comments
 (0)