staging: mmal-vchiq: Fix memory leak for vchi_instance 65/246165/1
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 26 Oct 2020 07:37:19 +0000 (16:37 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 26 Oct 2020 07:42:32 +0000 (16:42 +0900)
commitf7cc59406d8bae7f86d817f3b126597bc809984a
tree0412b429794499a6585f37ba30401951e39e3239
parente805316d5d44b1f1f080fd8ae8a34b69329d940c
staging: mmal-vchiq: Fix memory leak for vchi_instance

The vchi_instance is allocated with vchiq_initialise() but never
handled properly. Fix memory leak for the vchi_instance.

This fixes below kmemleak report:
    [<000000002312557f>] kmem_cache_alloc_trace+0x1e0/0x348
    [<000000002ee5d470>] vchiq_initialise+0xd0/0x258
    [<000000009b51d8f4>] vchi_initialise+0x84/0xc8
    [<00000000a58f68c5>] vchiq_mmal_init+0xb0/0x2f0
    [<000000006c68d7bf>] bcm2835_mmal_probe+0x90/0x660
    ...

Change-Id: Ib10f194aa4058b3e39ec0a250fa36fd00daf9feb
Reported-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c