From: Konstantin Khlebnikov Date: Thu, 6 Sep 2018 08:05:44 +0000 (+0300) Subject: block: bfq: swap puts in bfqg_and_blkg_put X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=d5274b3cd6a814ccb2f56d81ee87cbbf51bd4cf7;p=openwrt%2Fstaging%2Fblogic.git block: bfq: swap puts in bfqg_and_blkg_put Fix trivial use-after-free. This could be last reference to bfqg. Fixes: 8f9bebc33dd7 ("block, bfq: access and cache blkg data only when safe") Acked-by: Paolo Valente Signed-off-by: Konstantin Khlebnikov Signed-off-by: Jens Axboe --- diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c index 58c6efa9f9a9..9fe5952d117d 100644 --- a/block/bfq-cgroup.c +++ b/block/bfq-cgroup.c @@ -275,9 +275,9 @@ static void bfqg_and_blkg_get(struct bfq_group *bfqg) void bfqg_and_blkg_put(struct bfq_group *bfqg) { - bfqg_put(bfqg); - blkg_put(bfqg_to_blkg(bfqg)); + + bfqg_put(bfqg); } /* @stats = 0 */