]> git.baikalelectronics.ru Git - kernel.git/commit
blkcg: Unlock blkcg_pol_mutex only once when cpd == NULL
authorBart Van Assche <bart.vanassche@sandisk.com>
Thu, 29 Sep 2016 15:33:30 +0000 (08:33 -0700)
committerTejun Heo <tj@kernel.org>
Fri, 30 Sep 2016 08:31:20 +0000 (10:31 +0200)
commit91a8facbe67554c03bc2d7bac31fe8a331cbca97
treef52002457cef52dd9e3cdcb490b6342a81767d9f
parent6874776da65c5dd4301b8acf5edb8fd571474b44
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: 77646dfcd7ed ("blkcg: fix blkcg_policy_data allocation bug")
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: <stable@vger.kernel.org> # v4.2+
Signed-off-by: Tejun Heo <tj@kernel.org>
block/blk-cgroup.c