Loading drivers/gpu/msm/kgsl.c +11 −8 Original line number Diff line number Diff line Loading @@ -1072,25 +1072,28 @@ static void device_release_contexts(struct kgsl_device_private *dev_priv) struct kgsl_device *device = dev_priv->device; struct kgsl_context *context; int next = 0; int result = 0; while (1) { read_lock(&device->context_lock); context = idr_get_next(&device->context_idr, &next); read_unlock(&device->context_lock); if (context == NULL) if (context == NULL) { read_unlock(&device->context_lock); break; if (context->dev_priv == dev_priv) { } else if (context->dev_priv == dev_priv) { /* * Hold a reference to the context in case somebody * tries to put it while we are detaching */ result = _kgsl_context_get(context); } read_unlock(&device->context_lock); if (_kgsl_context_get(context)) { if (result) { kgsl_context_detach(context); kgsl_context_put(context); } result = 0; } next = next + 1; Loading Loading
drivers/gpu/msm/kgsl.c +11 −8 Original line number Diff line number Diff line Loading @@ -1072,25 +1072,28 @@ static void device_release_contexts(struct kgsl_device_private *dev_priv) struct kgsl_device *device = dev_priv->device; struct kgsl_context *context; int next = 0; int result = 0; while (1) { read_lock(&device->context_lock); context = idr_get_next(&device->context_idr, &next); read_unlock(&device->context_lock); if (context == NULL) if (context == NULL) { read_unlock(&device->context_lock); break; if (context->dev_priv == dev_priv) { } else if (context->dev_priv == dev_priv) { /* * Hold a reference to the context in case somebody * tries to put it while we are detaching */ result = _kgsl_context_get(context); } read_unlock(&device->context_lock); if (_kgsl_context_get(context)) { if (result) { kgsl_context_detach(context); kgsl_context_put(context); } result = 0; } next = next + 1; Loading