Fix a missing unlock in the error branch.

Signed-off-by: Zheng Yongjun <[email protected]>
---
 fs/pstore/zone.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/pstore/zone.c b/fs/pstore/zone.c
index 3ce89216670c..569404d56db0 100644
--- a/fs/pstore/zone.c
+++ b/fs/pstore/zone.c
@@ -1403,6 +1403,7 @@ int register_pstore_zone(struct pstore_zone_info *info)
                goto fail_free;
        }
        mutex_unlock(&pstore_zone_cxt.pstore_zone_info_lock);
+       mutex_unlock(&cxt->pstore_zone_info_lock);
 
        return 0;
 
@@ -1414,6 +1415,7 @@ int register_pstore_zone(struct pstore_zone_info *info)
 fail_out:
        pstore_zone_cxt.pstore_zone_info = NULL;
        mutex_unlock(&pstore_zone_cxt.pstore_zone_info_lock);
+       mutex_unlock(&cxt->pstore_zone_info_lock);
        return err;
 }
 EXPORT_SYMBOL_GPL(register_pstore_zone);
-- 
2.22.0

Reply via email to