From: Johan Hovold Date: Wed, 4 Nov 2015 17:55:23 +0000 (+0100) Subject: greybus: es2: clean up es2 destructor X-Git-Tag: v4.9.8~1233^2~378^2~21^2~1052 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a52028626accc2ae26c9ce03ec7bba68146b8456;p=platform%2Fkernel%2Flinux-rpi3.git greybus: es2: clean up es2 destructor Now that the host-device is deregistered separately from deallocation, we can simplify the cport_to_ep-array deallocation. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c index aad6451..c1a6fe4 100644 --- a/drivers/staging/greybus/es2.c +++ b/drivers/staging/greybus/es2.c @@ -550,7 +550,6 @@ static int check_urb_status(struct urb *urb) static void es2_destroy(struct es2_ap_dev *es2) { struct usb_device *udev; - int *cport_to_ep; int bulk_in; int i; @@ -583,11 +582,11 @@ static void es2_destroy(struct es2_ap_dev *es2) } } + kfree(es2->cport_to_ep); + udev = es2->usb_dev; - cport_to_ep = es2->cport_to_ep; gb_hd_put(es2->hd); - kfree(cport_to_ep); usb_put_dev(udev); }