Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 027647a4 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "block: test-iosched: Restrict number of bios in the test request"

parents 7de44028 e62f72ef
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, 2017 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -316,6 +316,13 @@ struct test_request *test_iosched_create_test_req(
		goto err;
	}

	/* Restrict num_bios value as it may lead to bios_buffer overflow */
	if (num_bios >= BLK_MAX_SEGMENTS) {
		pr_warn("%s: num_bios %d is changed to BLK_MAX_SEGMENTS\n",
				__func__, num_bios);
		num_bios = BLK_MAX_SEGMENTS;
	}

	test_rq->buf_size = TEST_BIO_SIZE * num_bios;
	test_rq->wr_rd_data_pattern = pattern;