This is a note to let you know that I've just added the patch titled

    usb: gadget: phonet: free requests in pn_bind()'s error path

to the 3.7-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-gadget-phonet-free-requests-in-pn_bind-s-error-path.patch
and it can be found in the queue-3.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From d0eca719dd11ad0619e8dd6a1f3eceb95b0216dd Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <[email protected]>
Date: Mon, 22 Oct 2012 22:15:04 +0200
Subject: usb: gadget: phonet: free requests in pn_bind()'s error path

From: Sebastian Andrzej Siewior <[email protected]>

commit d0eca719dd11ad0619e8dd6a1f3eceb95b0216dd upstream.

Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/usb/gadget/f_phonet.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/drivers/usb/gadget/f_phonet.c
+++ b/drivers/usb/gadget/f_phonet.c
@@ -531,7 +531,7 @@ int pn_bind(struct usb_configuration *c,
 
                req = usb_ep_alloc_request(fp->out_ep, GFP_KERNEL);
                if (!req)
-                       goto err;
+                       goto err_req;
 
                req->complete = pn_rx_complete;
                fp->out_reqv[i] = req;
@@ -540,14 +540,18 @@ int pn_bind(struct usb_configuration *c,
        /* Outgoing USB requests */
        fp->in_req = usb_ep_alloc_request(fp->in_ep, GFP_KERNEL);
        if (!fp->in_req)
-               goto err;
+               goto err_req;
 
        INFO(cdev, "USB CDC Phonet function\n");
        INFO(cdev, "using %s, OUT %s, IN %s\n", cdev->gadget->name,
                fp->out_ep->name, fp->in_ep->name);
        return 0;
 
+err_req:
+       for (i = 0; i < phonet_rxq_size && fp->out_reqv[i]; i++)
+               usb_ep_free_request(fp->out_ep, fp->out_reqv[i]);
 err:
+
        if (fp->out_ep)
                fp->out_ep->driver_data = NULL;
        if (fp->in_ep)


Patches currently in stable-queue which might be from [email protected] are

queue-3.7/usb-gadget-phonet-free-requests-in-pn_bind-s-error-path.patch
queue-3.7/usb-gadget-tcm_usb_gadget-null-terminate-the-fs-descriptor-list.patch
queue-3.7/usb-gadget-midi-free-hs-descriptors.patch
queue-3.7/usb-gadget-uvc-fix-error-path-in-uvc_function_bind.patch
queue-3.7/usb-gadget-network-fix-bind-error-path.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to