From: Oleg Drokin Date: Mon, 30 May 2022 07:05:23 +0000 (-0400) Subject: LU-15901 mdc: Remove entry from list before freeing X-Git-Tag: 2.15.51~114 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F80%2F47480%2F3;p=fs%2Flustre-release.git LU-15901 mdc: Remove entry from list before freeing mdc_changelog_cdev_init forgot to remove entries from list if chardev allocation failed Change-Id: Ic76b5320bf80c7f7f60c7682bda4bc37a0b300bd Fixes: d0423abc1ad ("LU-12506 changelog: support large number of MDT") Signed-off-by: Oleg Drokin Reviewed-on: https://review.whamcloud.com/47480 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: James Simmons --- diff --git a/lustre/mdc/mdc_changelog.c b/lustre/mdc/mdc_changelog.c index 843c4de..853bee2 100644 --- a/lustre/mdc/mdc_changelog.c +++ b/lustre/mdc/mdc_changelog.c @@ -826,7 +826,7 @@ int mdc_changelog_cdev_init(struct obd_device *obd) rc = chlg_minor_alloc(&minor); if (rc) - GOTO(out_unlock, rc); + GOTO(out_listrm, rc); device_initialize(&entry->ced_device); entry->ced_device.devt = MKDEV(MAJOR(mdc_changelog_dev), minor); @@ -854,6 +854,7 @@ out_device_name: out_minor: chlg_minor_free(minor); +out_listrm: list_del_init(&obd->u.cli.cl_chg_dev_linkage); list_del(&entry->ced_link);