diff --git a/modules/cas_cache/classifier.c b/modules/cas_cache/classifier.c index 70bbf9eaf..b946a847e 100644 --- a/modules/cas_cache/classifier.c +++ b/modules/cas_cache/classifier.c @@ -203,6 +203,10 @@ static int _cas_cls_string_ctr(struct cas_classifier *cls, CAS_CLS_MSG(KERN_ERR, "String specifier is empty\n"); return -EINVAL; } + if (len == MAX_STRING_SPECIFIER_LEN) { + CAS_CLS_MSG(KERN_ERR, "String specifier is too long\n"); + return -EINVAL; + } ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); if (!ctx) diff --git a/modules/cas_cache/ocf_env.c b/modules/cas_cache/ocf_env.c index 33ff384b3..bdb66d221 100644 --- a/modules/cas_cache/ocf_env.c +++ b/modules/cas_cache/ocf_env.c @@ -43,7 +43,7 @@ struct _env_allocator_item { void *env_allocator_new(env_allocator *allocator) { struct _env_allocator_item *item = NULL; - int cpu; + int cpu = 0; if (allocator->rpool) item = cas_rpool_try_get(allocator->rpool, &cpu); diff --git a/modules/cas_cache/volume/vol_blk_utils.c b/modules/cas_cache/volume/vol_blk_utils.c index 3cb374821..79368c655 100644 --- a/modules/cas_cache/volume/vol_blk_utils.c +++ b/modules/cas_cache/volume/vol_blk_utils.c @@ -241,7 +241,9 @@ int cas_blk_open_volume_by_bdev(ocf_volume_t *vol, struct block_device *bdev) bdobj->btm_bd = bdev; bdobj->opened_by_bdev = true; - return ocf_volume_open(*vol, NULL); + ret = ocf_volume_open(*vol, NULL); + if (ret) + ocf_volume_destroy(*vol); err: return ret; diff --git a/modules/cas_cache/volume/vol_block_dev_top.c b/modules/cas_cache/volume/vol_block_dev_top.c index 5ea79597f..7fb64b58e 100644 --- a/modules/cas_cache/volume/vol_block_dev_top.c +++ b/modules/cas_cache/volume/vol_block_dev_top.c @@ -742,8 +742,10 @@ static int kcas_core_stop_exported_object(ocf_core_t core, void *cntx) casdisk_functions.casdsk_exp_obj_get_gendisk(bvol->dsk)->disk_name); ret = casdisk_functions.casdsk_exp_obj_destroy(bvol->dsk); - if (!ret) + if (!ret) { bvol->expobj_valid = false; + destroy_workqueue(bvol->expobj_wq); + } } if (bvol->expobj_locked) { diff --git a/ocf b/ocf index a0bf8587a..99608c9a3 160000 --- a/ocf +++ b/ocf @@ -1 +1 @@ -Subproject commit a0bf8587a0a3652432dea827f2e8b1b3218a2010 +Subproject commit 99608c9a306e3e2a4f586eb097ae03d321b518ef