Merge pull request #1175 from mmichal10/secure-fixes
Fixes for Coverity static analysis tool findings
This commit is contained in:
commit
954d2be486
@ -203,6 +203,10 @@ static int _cas_cls_string_ctr(struct cas_classifier *cls,
|
|||||||
CAS_CLS_MSG(KERN_ERR, "String specifier is empty\n");
|
CAS_CLS_MSG(KERN_ERR, "String specifier is empty\n");
|
||||||
return -EINVAL;
|
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);
|
ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
|
||||||
if (!ctx)
|
if (!ctx)
|
||||||
|
@ -43,7 +43,7 @@ struct _env_allocator_item {
|
|||||||
void *env_allocator_new(env_allocator *allocator)
|
void *env_allocator_new(env_allocator *allocator)
|
||||||
{
|
{
|
||||||
struct _env_allocator_item *item = NULL;
|
struct _env_allocator_item *item = NULL;
|
||||||
int cpu;
|
int cpu = 0;
|
||||||
|
|
||||||
if (allocator->rpool)
|
if (allocator->rpool)
|
||||||
item = cas_rpool_try_get(allocator->rpool, &cpu);
|
item = cas_rpool_try_get(allocator->rpool, &cpu);
|
||||||
|
@ -241,7 +241,9 @@ int cas_blk_open_volume_by_bdev(ocf_volume_t *vol, struct block_device *bdev)
|
|||||||
bdobj->btm_bd = bdev;
|
bdobj->btm_bd = bdev;
|
||||||
bdobj->opened_by_bdev = true;
|
bdobj->opened_by_bdev = true;
|
||||||
|
|
||||||
return ocf_volume_open(*vol, NULL);
|
ret = ocf_volume_open(*vol, NULL);
|
||||||
|
if (ret)
|
||||||
|
ocf_volume_destroy(*vol);
|
||||||
|
|
||||||
err:
|
err:
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -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);
|
casdisk_functions.casdsk_exp_obj_get_gendisk(bvol->dsk)->disk_name);
|
||||||
|
|
||||||
ret = casdisk_functions.casdsk_exp_obj_destroy(bvol->dsk);
|
ret = casdisk_functions.casdsk_exp_obj_destroy(bvol->dsk);
|
||||||
if (!ret)
|
if (!ret) {
|
||||||
bvol->expobj_valid = false;
|
bvol->expobj_valid = false;
|
||||||
|
destroy_workqueue(bvol->expobj_wq);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bvol->expobj_locked) {
|
if (bvol->expobj_locked) {
|
||||||
|
2
ocf
2
ocf
@ -1 +1 @@
|
|||||||
Subproject commit a0bf8587a0a3652432dea827f2e8b1b3218a2010
|
Subproject commit 99608c9a306e3e2a4f586eb097ae03d321b518ef
|
Loading…
Reference in New Issue
Block a user