VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Yu Kuai <yukuai3@huawei.com> 2021-08-05 20:46:45 +0800 committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2021-08-12 13:32:11 +0200 commit: 5c4139e2e299607cd91072e2cd966c79099c6d5f parent: fc443dec378613618b8c15194a278af9dbd926d0
Commit Summary:
blk-iolatency: error out if blk_get_queue() failed in iolatency_set_limit()
Diffstat:
1 file changed, 5 insertions, 1 deletion
diff --git a/block/blk-iolatency.c b/block/blk-iolatency.c
index 81be0096411d..d8b0d8bd132b 100644
--- a/block/blk-iolatency.c
+++ b/block/blk-iolatency.c
@@ -833,7 +833,11 @@ static ssize_t iolatency_set_limit(struct kernfs_open_file *of, char *buf,
 
 	enable = iolatency_set_min_lat_nsec(blkg, lat_val);
 	if (enable) {
-		WARN_ON_ONCE(!blk_get_queue(blkg->q));
+		if (!blk_get_queue(blkg->q)) {
+			ret = -ENODEV;
+			goto out;
+		}
+
 		blkg_get(blkg);
 	}