usb: gadget: ffs: fix enable multiple instances
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Mon, 11 Mar 2013 15:32:14 +0000 (16:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Mar 2013 19:18:02 +0000 (12:18 -0700)
commita9cc438a69cc909ddfe9df5b2d9d2a26e90eaa9a
tree3658d12a53a846a9675529ce8141ded1344744f8
parent810a2afaca15e49ae85c0b1775a224431ebf0348
usb: gadget: ffs: fix enable multiple instances

commit 3416905ba058e43112ad7b1b4859797f027f5a07 upstream.

This patch fixes an "off-by-one" bug found in
581791f (FunctionFS: enable multiple functions).

During gfs_bind/gfs_unbind the functionfs_bind/functionfs_unbind should be
called for every functionfs instance. With the "i" pre-decremented they
were not called for the zeroth instance.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
[ balbi@ti.com : added offending commit's subject ]
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/g_ffs.c