Fix for using uninitialized variable in printk

This commit fixes the case of using unintialized variable in error
handling path after failed core addition.

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
This commit is contained in:
Krzysztof Majzerowicz-Jaszcz 2022-11-08 11:47:23 +00:00
parent 83f1a56f0d
commit 2eef5ce36b

View File

@ -516,7 +516,6 @@ static int kcas_volume_create_exported_object(ocf_volume_t volume,
const char *name, void *priv, struct cas_exp_obj_ops *ops) const char *name, void *priv, struct cas_exp_obj_ops *ops)
{ {
struct bd_object *bvol = bd_object(volume); struct bd_object *bvol = bd_object(volume);
char dev_name[DISK_NAME_LEN];
int result; int result;
bvol->expobj_wq = alloc_workqueue("expobj_wq_%s", bvol->expobj_wq = alloc_workqueue("expobj_wq_%s",
@ -539,7 +538,7 @@ static int kcas_volume_create_exported_object(ocf_volume_t volume,
end: end:
if (result) { if (result) {
printk(KERN_ERR "Cannot create exported object %s. Error code %d\n", printk(KERN_ERR "Cannot create exported object %s. Error code %d\n",
dev_name, result); name, result);
} }
return result; return result;
} }