mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
adsprpc: Move sleepable operations outside spin_lock
Use flag to inidcate the allocation of memory to the buffer and move sleepable operation: kzalloc outside spin_lock. Change-Id: Ic5983be3d65a41dfa389f817db8d44a55e068771 Signed-off-by: Jeya R <jeyr@codeaurora.org>
This commit is contained in:
parent
6a91a7d54b
commit
3cb776ebaa
1 changed files with 5 additions and 2 deletions
|
|
@ -588,6 +588,8 @@ struct fastrpc_file {
|
|||
/* Identifies the device (MINOR_NUM_DEV / MINOR_NUM_SECURE_DEV) */
|
||||
int dev_minor;
|
||||
char *debug_buf;
|
||||
/* Flag to indicate attempt has been made to allocate memory for debug_buf*/
|
||||
int debug_buf_alloced_attempted;
|
||||
/* Flag to enable PM wake/relax voting for every remote invoke */
|
||||
int wake_enable;
|
||||
struct gid_list gidlist;
|
||||
|
|
@ -5313,12 +5315,13 @@ static int fastrpc_set_process_info(struct fastrpc_file *fl)
|
|||
+ strlen(strpid) + 1;
|
||||
|
||||
spin_lock(&fl->hlock);
|
||||
if (fl->debug_buf) {
|
||||
if (fl->debug_buf_alloced_attempted) {
|
||||
spin_unlock(&fl->hlock);
|
||||
return err;
|
||||
}
|
||||
fl->debug_buf = kzalloc(buf_size, GFP_KERNEL);
|
||||
fl->debug_buf_alloced_attempted = 1;
|
||||
spin_unlock(&fl->hlock);
|
||||
fl->debug_buf = kzalloc(buf_size, GFP_KERNEL);
|
||||
|
||||
if (!fl->debug_buf) {
|
||||
err = -ENOMEM;
|
||||
|
|
|
|||
Loading…
Reference in a new issue