[3.16.y-ckt extended stable] Patch "usb: gadget: f_fs: remove redundant ffs_data_get()" has been added to staging queue
Luis Henriques
luis.henriques at canonical.com
Mon Nov 10 11:33:11 UTC 2014
This is a note to let you know that I have just added a patch titled
usb: gadget: f_fs: remove redundant ffs_data_get()
to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.16.y-queue
This patch is scheduled to be released in version 3.16.7-ckt1.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Luis
------
>From 550b435c9f6c819c97519e4b055c3414096736f1 Mon Sep 17 00:00:00 2001
From: Robert Baldyga <r.baldyga at samsung.com>
Date: Thu, 9 Oct 2014 09:41:16 +0200
Subject: usb: gadget: f_fs: remove redundant ffs_data_get()
commit a3058a5d82e296daaca07411c3738a9ddd79f302 upstream.
During FunctionFS bind, ffs_data_get() function was called twice
(in functionfs_bind() and in ffs_do_functionfs_bind()), while on unbind
ffs_data_put() was called once (in functionfs_unbind() function).
In result refcount never reached value 0, and ffs memory resources has
been never released.
Since ffs_data_get() call in ffs_do_functionfs_bind() is redundant
and not neccessary, we remove it to have equal number of gets ans puts,
and free allocated memory after refcount reach 0.
Fixes: 5920cda (usb: gadget: FunctionFS: convert to new function
interface with backward compatibility)
Signed-off-by: Robert Baldyga <r.baldyga at samsung.com>
Signed-off-by: Felipe Balbi <balbi at ti.com>
[ luis: backported to 3.16: file rename:
drivers/usb/gadget/function/f_fs.c -> drivers/usb/gadget/f_fs.c ]
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
drivers/usb/gadget/f_fs.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
index 8598c27c7d43..538300c05c5a 100644
--- a/drivers/usb/gadget/f_fs.c
+++ b/drivers/usb/gadget/f_fs.c
@@ -2297,8 +2297,6 @@ static inline struct f_fs_opts *ffs_do_functionfs_bind(struct usb_function *f,
func->conf = c;
func->gadget = c->cdev->gadget;
- ffs_data_get(func->ffs);
-
/*
* in drivers/usb/gadget/configfs.c:configfs_composite_bind()
* configurations are bound in sequence with list_for_each_entry,
--
2.1.0
More information about the kernel-team
mailing list