From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> sysfs_read() allocates and populates a struct mdinfo, however the code forgot to free it again, before dropping the reference to the pointer. Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> --- Manage.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Manage.c b/Manage.c index a812ba0..9d2e0d0 100644 --- a/Manage.c +++ b/Manage.c @@ -944,10 +944,13 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv, } if (strncmp(mdp->sysfs_array_state, "readonly", 8) != 0) { + sysfs_free(mdp); pr_err("%s is not readonly, cannot add journal.\n", devname); return -1; } + sysfs_free(mdp); + tst->ss->getinfo_super(tst, &mdi, NULL); if (mdi.journal_device_required == 0) { pr_err("%s does not support journal device.\n", devname); -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html