diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index b81559787..53f2b71ca 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -4329,9 +4329,9 @@ struct scst_acg *scst_alloc_add_acg(struct scst_tgt *tgt, if (rc != 0) goto out_del; } -#endif kobject_get(&tgt->tgt_kobj); +#endif out: TRACE_EXIT_HRES(acg); @@ -4418,7 +4418,9 @@ static void scst_free_acg(struct scst_acg *acg) kfree(acg->acg_name); kfree(acg); +#ifndef CONFIG_SCST_PROC kobject_put(&tgt->tgt_kobj); +#endif } static void scst_release_acg(struct kref *kref)