ocf: add check ctx.
Check ocf_cache_get_priv return value if returns NULL, just exit. To avoid error. Signed-off-by: yidong0635 <dongx.yi@intel.com> Change-Id: Id94c4faa537f19ce9b657fbfe82ba76e2a414125 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4436 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
4cade5a73c
commit
a1b31293e8
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user