Loading drivers/gpu/msm/kgsl_sharedmem.c +14 −8 Original line number Diff line number Diff line Loading @@ -126,12 +126,10 @@ static ssize_t mem_entry_sysfs_show(struct kobject *kobj, ssize_t ret; /* * 1. sysfs_remove_file waits for reads to complete before the node * is deleted. * 2. kgsl_process_init_sysfs takes a refcount to the process_private, * which is put at the end of kgsl_process_uninit_sysfs. * These two conditions imply that priv will not be freed until this * function completes, and no further locking is needed. * kgsl_process_init_sysfs takes a refcount to the process_private, * which is put when the kobj is released. This implies that priv will * not be freed until this function completes, and no further locking * is needed. */ priv = kobj ? container_of(kobj, struct kgsl_process_private, kobj) : NULL; Loading @@ -144,12 +142,22 @@ static ssize_t mem_entry_sysfs_show(struct kobject *kobj, return ret; } static void mem_entry_release(struct kobject *kobj) { struct kgsl_process_private *priv; priv = container_of(kobj, struct kgsl_process_private, kobj); /* Put the refcount we got in kgsl_process_init_sysfs */ kgsl_process_private_put(priv); } static const struct sysfs_ops mem_entry_sysfs_ops = { .show = mem_entry_sysfs_show, }; static struct kobj_type ktype_mem_entry = { .sysfs_ops = &mem_entry_sysfs_ops, .release = &mem_entry_release, }; static struct mem_entry_stats mem_stats[] = { Loading @@ -172,8 +180,6 @@ kgsl_process_uninit_sysfs(struct kgsl_process_private *private) } kobject_put(&private->kobj); /* Put the refcount we got in kgsl_process_init_sysfs */ kgsl_process_private_put(private); } /** Loading Loading
drivers/gpu/msm/kgsl_sharedmem.c +14 −8 Original line number Diff line number Diff line Loading @@ -126,12 +126,10 @@ static ssize_t mem_entry_sysfs_show(struct kobject *kobj, ssize_t ret; /* * 1. sysfs_remove_file waits for reads to complete before the node * is deleted. * 2. kgsl_process_init_sysfs takes a refcount to the process_private, * which is put at the end of kgsl_process_uninit_sysfs. * These two conditions imply that priv will not be freed until this * function completes, and no further locking is needed. * kgsl_process_init_sysfs takes a refcount to the process_private, * which is put when the kobj is released. This implies that priv will * not be freed until this function completes, and no further locking * is needed. */ priv = kobj ? container_of(kobj, struct kgsl_process_private, kobj) : NULL; Loading @@ -144,12 +142,22 @@ static ssize_t mem_entry_sysfs_show(struct kobject *kobj, return ret; } static void mem_entry_release(struct kobject *kobj) { struct kgsl_process_private *priv; priv = container_of(kobj, struct kgsl_process_private, kobj); /* Put the refcount we got in kgsl_process_init_sysfs */ kgsl_process_private_put(priv); } static const struct sysfs_ops mem_entry_sysfs_ops = { .show = mem_entry_sysfs_show, }; static struct kobj_type ktype_mem_entry = { .sysfs_ops = &mem_entry_sysfs_ops, .release = &mem_entry_release, }; static struct mem_entry_stats mem_stats[] = { Loading @@ -172,8 +180,6 @@ kgsl_process_uninit_sysfs(struct kgsl_process_private *private) } kobject_put(&private->kobj); /* Put the refcount we got in kgsl_process_init_sysfs */ kgsl_process_private_put(private); } /** Loading