USB: fix usb gadget ffs string id bug.
authorwlf <wulf@rock-chips.com>
Wed, 11 Jun 2014 02:45:44 +0000 (10:45 +0800)
committerwlf <wulf@rock-chips.com>
Wed, 11 Jun 2014 02:45:44 +0000 (10:45 +0800)
drivers/usb/gadget/android.c

index aade8773c8a2a4753db579b106733d835046a022..58c2b3c1c4d1a0ce99546742caf2d7ddad41cdd1 100755 (executable)
@@ -347,6 +347,9 @@ static void functionfs_closed_callback(struct ffs_data *ffs)
        config->opened = false;
        config->data = NULL;
 
+       if (!WARN_ON(!ffs->gadget)) {
+               dev->cdev->next_string_id -= ffs->strings_count;
+       }
        functionfs_unbind(ffs);
 
        mutex_unlock(&dev->mutex);