Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qcacld-3.0: Fix memory leak in driver dump
Currently when driver gets a command to dump the driver info, it allocates the memory and retrieves the information in that allocated memory. Maximum data that can be copied to user space buffer is equal to one PAGE_SIZE. In the command driver gets the size of the data which user space wants to read, minimum of the user space requested size or one PAGE_SIZE of the data is copied to user space buffer and current position of the driver buffer till which the data is copied is updated to user space is also updated. Driver copies the retrieved information to the user space buffer as explained above and updates the position pointer to the user space. In the next request driver expects from user space to request the remaining data from the updated position in last request, once all the data is copied to user space, driver frees internally allocated memory. In case if driver does not get the request to read remaining data after first request, it does not free the memory. Current handling of this memory is done in init domain after stop modules, but since this memory is allocated in active domain, driver should free the memory in active domain. Since with current implementation memory allocated in active domain is not freed in active domain, memleak is getting detected. To resolve above issue, move mem cleanup logic for driver dump info command from init domain to active domain in stop modules. Change-Id: Idb4f35f0a599ad55eebe13348b68562fa401fd7e CRs-Fixed: 2489877
- Loading branch information