@@ -549,22 +549,22 @@ static int get_daio_rsc(struct daio_mgr *mgr,
dao = kzalloc(sizeof(*dao), GFP_KERNEL);
if (!dao) {
err = -ENOMEM;
- goto error;
+ goto alloc_error;
}
err = dao_rsc_init(dao, desc, mgr);
if (err)
- goto error;
+ goto dao_init_error;
*rdaio = &dao->daio;
} else {
dai = kzalloc(sizeof(*dai), GFP_KERNEL);
if (!dai) {
err = -ENOMEM;
- goto error;
+ goto alloc_error;
}
err = dai_rsc_init(dai, desc, mgr);
if (err)
- goto error;
+ goto dai_init_error;
*rdaio = &dai->daio;
}
@@ -574,12 +574,12 @@ static int get_daio_rsc(struct daio_mgr *mgr,
return 0;
-error:
- if (dao)
- kfree(dao);
- else
- kfree(dai);
-
+dao_init_error:
+ kfree(dao);
+ goto alloc_error;
+dai_init_error:
+ kfree(dai);
+alloc_error:
spin_lock_irqsave(&mgr->mgr_lock, flags);
daio_mgr_put_rsc(&mgr->mgr, desc->type);
spin_unlock_irqrestore(&mgr->mgr_lock, flags);