5ccc94a1eb3068725c6b8fc475dd851af448bbc1
[openwrt/staging/blogic.git] /
1 From 114ed29563e1f47ebe7aaab8c9ea3872c71208b2 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Fri, 8 Mar 2019 11:11:46 +0000
4 Subject: [PATCH 375/782] staging: vc-sm-cma: Ensure mutex and idr are
5 destroyed
6
7 map_lock and kernelid_map are created in probe, but not released
8 in release should the vcsm service not connect (eg running the
9 cutdown firmware).
10
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
12 ---
13 drivers/staging/vc04_services/vc-sm-cma/vc_sm.c | 2 ++
14 1 file changed, 2 insertions(+)
15
16 --- a/drivers/staging/vc04_services/vc-sm-cma/vc_sm.c
17 +++ b/drivers/staging/vc04_services/vc-sm-cma/vc_sm.c
18 @@ -752,7 +752,9 @@ static int bcm2835_vc_sm_cma_remove(stru
19
20 /* Stop the videocore shared memory service. */
21 vc_sm_cma_vchi_stop(&sm_state->sm_handle);
22 + }
23
24 + if (sm_state) {
25 idr_destroy(&sm_state->kernelid_map);
26
27 /* Free the memory for the state structure. */