From: Vaibhav Agarwal Date: Fri, 27 May 2016 05:19:24 +0000 (+0530) Subject: greybus: es2: Release reserved cports CDSI0 and CDSI1 X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~336 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=52033fdebc92021490729465e27ffb47cd42b0e0;p=karo-tx-linux.git greybus: es2: Release reserved cports CDSI0 and CDSI1 Unique ids were reserved for CDSI0 and CDSI1 during _probe, however missed to release those ids during disconnect. This causes a memory leak of 128 bytes for each iteration of unipro_reset. Fix this. Signed-off-by: Vaibhav Agarwal Reviewed-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c index 24fef349eb36..fd59c143d0f3 100644 --- a/drivers/staging/greybus/es2.c +++ b/drivers/staging/greybus/es2.c @@ -869,6 +869,10 @@ static void es2_destroy(struct es2_ap_dev *es2) kfree(es2->cport_to_ep); + /* release reserved CDSI0 and CDSI1 cports */ + gb_hd_cport_release_reserved(es2->hd, ES2_CPORT_CDSI1); + gb_hd_cport_release_reserved(es2->hd, ES2_CPORT_CDSI0); + udev = es2->usb_dev; gb_hd_put(es2->hd);