Loading drivers/char/adsprpc.c +6 −1 Original line number Original line Diff line number Diff line Loading @@ -367,6 +367,7 @@ struct fastrpc_file { int qos_request; int qos_request; struct mutex map_mutex; struct mutex map_mutex; struct mutex fl_map_mutex; struct mutex fl_map_mutex; int refcount; }; }; static struct fastrpc_apps gfa; static struct fastrpc_apps gfa; Loading Loading @@ -2006,6 +2007,8 @@ static int fastrpc_init_process(struct fastrpc_file *fl, if (!strcmp(proc_name, "audiopd")) { if (!strcmp(proc_name, "audiopd")) { fl->spdname = AUDIO_PDR_SERVICE_LOCATION_CLIENT_NAME; fl->spdname = AUDIO_PDR_SERVICE_LOCATION_CLIENT_NAME; VERIFY(err, !fastrpc_mmap_remove_pdr(fl)); VERIFY(err, !fastrpc_mmap_remove_pdr(fl)); if (err) goto bail; } } if (!me->staticpd_flags) { if (!me->staticpd_flags) { Loading Loading @@ -2605,7 +2608,7 @@ static int fastrpc_file_free(struct fastrpc_file *fl) fastrpc_mmap_free(map, 1); fastrpc_mmap_free(map, 1); } } mutex_unlock(&fl->fl_map_mutex); mutex_unlock(&fl->fl_map_mutex); if (fl->ssrcount == fl->apps->channel[cid].ssrcount) if (fl->refcount && (fl->ssrcount == fl->apps->channel[cid].ssrcount)) kref_put_mutex(&fl->apps->channel[cid].kref, kref_put_mutex(&fl->apps->channel[cid].kref, fastrpc_channel_close, &fl->apps->smd_mutex); fastrpc_channel_close, &fl->apps->smd_mutex); if (fl->sctx) if (fl->sctx) Loading Loading @@ -2898,6 +2901,7 @@ static int fastrpc_channel_open(struct fastrpc_file *fl) } } } } fl->ssrcount = me->channel[cid].ssrcount; fl->ssrcount = me->channel[cid].ssrcount; fl->refcount = 1; if ((kref_get_unless_zero(&me->channel[cid].kref) == 0) || if ((kref_get_unless_zero(&me->channel[cid].kref) == 0) || (me->channel[cid].chan == NULL)) { (me->channel[cid].chan == NULL)) { if (me->glink) { if (me->glink) { Loading Loading @@ -2971,6 +2975,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp) if (debugfs_file != NULL) if (debugfs_file != NULL) fl->debugfs_file = debugfs_file; fl->debugfs_file = debugfs_file; fl->qos_request = 0; fl->qos_request = 0; fl->refcount = 0; filp->private_data = fl; filp->private_data = fl; mutex_init(&fl->map_mutex); mutex_init(&fl->map_mutex); mutex_init(&fl->fl_map_mutex); mutex_init(&fl->fl_map_mutex); Loading Loading
drivers/char/adsprpc.c +6 −1 Original line number Original line Diff line number Diff line Loading @@ -367,6 +367,7 @@ struct fastrpc_file { int qos_request; int qos_request; struct mutex map_mutex; struct mutex map_mutex; struct mutex fl_map_mutex; struct mutex fl_map_mutex; int refcount; }; }; static struct fastrpc_apps gfa; static struct fastrpc_apps gfa; Loading Loading @@ -2006,6 +2007,8 @@ static int fastrpc_init_process(struct fastrpc_file *fl, if (!strcmp(proc_name, "audiopd")) { if (!strcmp(proc_name, "audiopd")) { fl->spdname = AUDIO_PDR_SERVICE_LOCATION_CLIENT_NAME; fl->spdname = AUDIO_PDR_SERVICE_LOCATION_CLIENT_NAME; VERIFY(err, !fastrpc_mmap_remove_pdr(fl)); VERIFY(err, !fastrpc_mmap_remove_pdr(fl)); if (err) goto bail; } } if (!me->staticpd_flags) { if (!me->staticpd_flags) { Loading Loading @@ -2605,7 +2608,7 @@ static int fastrpc_file_free(struct fastrpc_file *fl) fastrpc_mmap_free(map, 1); fastrpc_mmap_free(map, 1); } } mutex_unlock(&fl->fl_map_mutex); mutex_unlock(&fl->fl_map_mutex); if (fl->ssrcount == fl->apps->channel[cid].ssrcount) if (fl->refcount && (fl->ssrcount == fl->apps->channel[cid].ssrcount)) kref_put_mutex(&fl->apps->channel[cid].kref, kref_put_mutex(&fl->apps->channel[cid].kref, fastrpc_channel_close, &fl->apps->smd_mutex); fastrpc_channel_close, &fl->apps->smd_mutex); if (fl->sctx) if (fl->sctx) Loading Loading @@ -2898,6 +2901,7 @@ static int fastrpc_channel_open(struct fastrpc_file *fl) } } } } fl->ssrcount = me->channel[cid].ssrcount; fl->ssrcount = me->channel[cid].ssrcount; fl->refcount = 1; if ((kref_get_unless_zero(&me->channel[cid].kref) == 0) || if ((kref_get_unless_zero(&me->channel[cid].kref) == 0) || (me->channel[cid].chan == NULL)) { (me->channel[cid].chan == NULL)) { if (me->glink) { if (me->glink) { Loading Loading @@ -2971,6 +2975,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp) if (debugfs_file != NULL) if (debugfs_file != NULL) fl->debugfs_file = debugfs_file; fl->debugfs_file = debugfs_file; fl->qos_request = 0; fl->qos_request = 0; fl->refcount = 0; filp->private_data = fl; filp->private_data = fl; mutex_init(&fl->map_mutex); mutex_init(&fl->map_mutex); mutex_init(&fl->fl_map_mutex); mutex_init(&fl->fl_map_mutex); Loading