Commit a1b31293 authored by yidong0635's avatar yidong0635 Committed by Tomasz Zawadzki
Browse files

ocf: add check ctx.



Check ocf_cache_get_priv return value if returns NULL, just exit.
To avoid error.

Signed-off-by: default avataryidong0635 <dongx.yi@intel.com>
Change-Id: Id94c4faa537f19ce9b657fbfe82ba76e2a414125
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4436


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 4cade5a7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -231,6 +231,9 @@ prepare_submit(struct ocf_io *io)

	cache = ocf_queue_get_cache(q);
	cctx = ocf_cache_get_priv(cache);
	if (cctx == NULL) {
		return -EFAULT;
	}

	if (q == cctx->cleaner_queue || q == cctx->mngt_queue) {
		io_ctx->ch = base->management_channel;