diff options
author | Konstantin Khlebnikov <khlebnikov@yandex-team.ru> | 2018-09-06 10:05:44 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-09-06 19:32:58 +0200 |
commit | d5274b3cd6a814ccb2f56d81ee87cbbf51bd4cf7 (patch) | |
tree | 0b89b27d5406615c5c235347583086bb6e3c7815 /block/bfq-cgroup.c | |
parent | block: don't warn when doing fsync on read-only devices (diff) | |
download | linux-d5274b3cd6a814ccb2f56d81ee87cbbf51bd4cf7.tar.xz linux-d5274b3cd6a814ccb2f56d81ee87cbbf51bd4cf7.zip |
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 <paolo.valente@linaro.org>
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bfq-cgroup.c')
-rw-r--r-- | block/bfq-cgroup.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 */ |