Skip to content

Commit

Permalink
block: bfq: swap puts in bfqg_and_blkg_put
Browse files Browse the repository at this point in the history
Fix trivial use-after-free. This could be last reference to bfqg.

Fixes: 8f9bebc ("block, bfq: access and cache blkg data only when safe")
Acked-by: Paolo Valente <[email protected]>
Signed-off-by: Konstantin Khlebnikov <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
koct9i authored and axboe committed Sep 6, 2018
1 parent 8b2ded1 commit d5274b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions block/bfq-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit d5274b3

Please sign in to comment.