[PATCH block/for-linus] blkcg: fix double unlock in blkcg_policy_register() error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



06b285bd1125 ("blkcg: fix blkcg_policy_data allocation bug")
introduced double unlock of blkcg_pol_mutx on allocation failure path.
Fix it.

Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Fixes: 06b285bd1125 ("blkcg: fix blkcg_policy_data allocation bug")
---
 block/blk-cgroup.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 9da02c0..24fb729 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1187,10 +1187,8 @@ int blkcg_policy_register(struct blkcg_policy *pol)
 			struct blkcg_policy_data *cpd;
 
 			cpd = kzalloc(pol->cpd_size, GFP_KERNEL);
-			if (!cpd) {
-				mutex_unlock(&blkcg_pol_mutex);
+			if (!cpd)
 				goto err_free_cpds;
-			}
 
 			blkcg->pd[pol->plid] = cpd;
 			cpd->plid = pol->plid;
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux