ClangBuiltLinux / thread-safety-analysis

A research project into applying Clang's Thread Safety Analysis to the Linux Kernel
Other
6 stars 0 forks source link

drivers/gpu/drm/i915/i915_reset.c: i915_gem_unset_wedged: use same alias for locking&unlocking #161

Open bulwahn opened 4 years ago

bulwahn commented 4 years ago
drivers/gpu/drm/i915/i915_reset.c:909:2: warning: releasing mutex 'dev_priv->gpu_error.wedge_mutex' that was not held [-Wthread-safety-analysis]
        mutex_unlock(&i915->gpu_error.wedge_mutex);
        ^
drivers/gpu/drm/i915/i915_reset.c:912:1: warning: mutex 'error->wedge_mutex' is not held on every path through here [-Wthread-safety-analysis]
}
^
drivers/gpu/drm/i915/i915_reset.c:846:2: note: mutex acquired here
        mutex_lock(&error->wedge_mutex);
        ^

Locking and unlocking uses two different aliases for the same lock. This can be resolved by just making the code consistent.