Commit aa345078 authored by Ben Walker's avatar Ben Walker Committed by Jim Harris
Browse files

vhost: Handle failed memory allocation when dumping config



Change-Id: I929e2a668189c36a8837ce8cb8731e394bcb6d9a
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408238


Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent b31d31b2
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1391,7 +1391,13 @@ spdk_vhost_config_json_cb(struct spdk_vhost_dev *vdev, void *arg)
void
spdk_vhost_config_json(struct spdk_json_write_ctx *w, struct spdk_event *done_ev)
{
	struct spdk_vhost_write_config_json_ctx *ctx = calloc(1, sizeof(*ctx));
	struct spdk_vhost_write_config_json_ctx *ctx;

	ctx = calloc(1, sizeof(*ctx));
	if (!ctx) {
		spdk_event_call(done_ev);
		return;
	}

	ctx->w = w;
	ctx->done_ev = done_ev;