Commit be74ac15 authored by Dong Yi's avatar Dong Yi Committed by Jim Harris
Browse files

event/app_rpc: Fix segmenation fault for scheduler is NULL.



Json writes this scheduler name using pointer, but it sometimes be null.
This case it exists, so add check for it.

Fixes issue #2384

Signed-off-by: default avatarDong Yi <dongx.yi@intel.com>
Change-Id: I7c989c72cfbd53ea6b02d86457b29440484e5a37
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11677


Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 21284e6c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -528,7 +528,9 @@ rpc_framework_get_scheduler(struct spdk_jsonrpc_request *request,

	w = spdk_jsonrpc_begin_result(request);
	spdk_json_write_object_begin(w);
	if (scheduler) {
		spdk_json_write_named_string(w, "scheduler_name", scheduler->name);
	}
	spdk_json_write_named_uint64(w, "scheduler_period", scheduler_period);
	if (governor != NULL) {
		spdk_json_write_named_string(w, "governor_name", governor->name);