mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-07 09:41:30 +00:00
dm: usb: fix possible memory leak
fix possible memory leak for usb. Tracked-On: #2704 Signed-off-by: Conghui Chen <conghui.chen@intel.com> Reviewed-by: Yuan Liu <yuan1.liu@intel.com> Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
@@ -857,6 +857,11 @@ usb_dev_data(void *pdata, struct usb_data_xfer *xfer, int dir, int epctx)
|
||||
|
||||
} else {
|
||||
UPRINTF(LFTL, "%s: wrong endpoint type %d\r\n", __func__, type);
|
||||
if (req->buffer)
|
||||
free(req->buffer);
|
||||
if (req->libusb_xfer)
|
||||
libusb_free_transfer(req->libusb_xfer);
|
||||
free(req);
|
||||
xfer->status = USB_ERR_INVAL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user