mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
blkcg: Unlock blkcg_pol_mutex only once when cpd == NULL
Unlocking a mutex twice is wrong. Hence modify blkcg_policy_register()
such that blkcg_pol_mutex is unlocked once if cpd == NULL. This patch
avoids that smatch reports the following error:
block/blk-cgroup.c:1378: blkcg_policy_register() error: double unlock 'mutex:&blkcg_pol_mutex'
Fixes: 06b285bd11 ("blkcg: fix blkcg_policy_data allocation bug")
Signed-off-by: Bart Van Assche <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: <[email protected]> # v4.2+
Signed-off-by: Tejun Heo <[email protected]>
This commit is contained in:
parent
e0223003e6
commit
bbb427e342
1 changed files with 1 additions and 3 deletions
|
|
@ -1340,10 +1340,8 @@ int blkcg_policy_register(struct blkcg_policy *pol)
|
|||
struct blkcg_policy_data *cpd;
|
||||
|
||||
cpd = pol->cpd_alloc_fn(GFP_KERNEL);
|
||||
if (!cpd) {
|
||||
mutex_unlock(&blkcg_pol_mutex);
|
||||
if (!cpd)
|
||||
goto err_free_cpds;
|
||||
}
|
||||
|
||||
blkcg->cpd[pol->plid] = cpd;
|
||||
cpd->blkcg = blkcg;
|
||||
|
|
|
|||
Loading…
Reference in a new issue