dm: fix some potential memory leaks

This patch is to fix some potential memory leak issues

1, free mrp if the mmio_rb_lookup() function return 0;
2, free memory allocated by strdup in some error case handling.

Tracked-On: #3277
Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Tianhua Sun
2019-06-14 16:04:47 +08:00
committed by wenlingz
parent 0620980fab
commit b0015963f5
2 changed files with 4 additions and 3 deletions

View File

@@ -4126,6 +4126,8 @@ errout:
free(xdev->portregs);
xdev->portregs = NULL;
}
if (rc < -2 && s)
free(s);
UPRINTF(LFTL, "fail to parse xHCI options, rc=%d\r\n", rc);
if (opts)