]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: gadget: f_fs: remove redundant ffs_data_get()
authorRobert Baldyga <r.baldyga@samsung.com>
Thu, 9 Oct 2014 07:41:16 +0000 (09:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Nov 2014 18:10:34 +0000 (10:10 -0800)
commit7591876f31136b3500336e26d2e756a8d2465b56
tree4631adb4922a74c44dece386fe9f5f5b27575ae5
parentd934b90e162cd7f0d4b28e5d65df35a065bdbdd4
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@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_fs.c