fb6ad95443be118f8da608bd83f5da07d9d9c7df
[oweals/openwrt.git] /
1 From 0382cc0391c16a76fdf6f1e53c17a0704648c6fb 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 376/773] 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. */