cfq-iosched: fix sysfs oops when attempting to read unconfigured weights
authorJens Axboe <axboe@fb.com>
Fri, 19 Jun 2015 16:19:36 +0000 (10:19 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 19 Jun 2015 16:19:36 +0000 (10:19 -0600)
commit9470e4a693db84bee7becbba8de01af02bb23c9f
tree9267bd9cd8d882e8996ba5b2df80ac4277909519
parent4ceab71b9d84e55b59a76b54b2999dc377aae6e6
cfq-iosched: fix sysfs oops when attempting to read unconfigured weights

If none of the devices in the system are using CFQ, then attempting to
read:

/sys/fs/cgroup/blkio/blkio.leaf_weight

will results in a NULL dereference. Check for a valid cfq_group_data
struct before attempting to dereference it.

Reported-by: Andrey Wagin <avagin@gmail.com>
Fixes: e48453c3 ("block, cgroup: implement policy-specific per-blkcg data")
Signed-off-by: Jens Axboe <axboe@fb.com>
block/cfq-iosched.c