bdev/null: Fix infinite loop in configuration parsing
Invalid configuration file parameter in Null bdev section results in
infinite loop.
Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464775 (master)
(cherry picked from commit e06e34be1d
)
Change-Id: I79a1a53e0f4d76a8724e7a624cabda7250b511c5
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467131
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
077ae9152d
commit
0b60d077cb
@ -1,8 +1,8 @@
|
|||||||
/*-
|
/*-
|
||||||
* BSD LICENSE
|
* BSD LICENSE
|
||||||
*
|
*
|
||||||
* Copyright (c) Intel Corporation.
|
* Copyright (c) Intel Corporation. All rights reserved.
|
||||||
* All rights reserved.
|
* Copyright (c) 2019 Mellanox Technologies LTD. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@ -318,8 +318,7 @@ bdev_null_initialize(void)
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
i = 0;
|
for (i = 0; ; ++i) {
|
||||||
while (true) {
|
|
||||||
val = spdk_conf_section_get_nval(sp, "Dev", i);
|
val = spdk_conf_section_get_nval(sp, "Dev", i);
|
||||||
if (val == NULL) {
|
if (val == NULL) {
|
||||||
break;
|
break;
|
||||||
@ -362,8 +361,6 @@ bdev_null_initialize(void)
|
|||||||
SPDK_ERRLOG("Could not create null bdev\n");
|
SPDK_ERRLOG("Could not create null bdev\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
end:
|
end:
|
||||||
if (rc) {
|
if (rc) {
|
||||||
|
Loading…
Reference in New Issue
Block a user