瀏覽代碼

usb: gadget: f_fs: Fix loop variable

Use if-loop variable 'epfile' instead of start variable 'epfiles'. Now the
correct endpoint file name is stored.

Signed-off-by: Mario Schuknecht <mario.schuknecht@dresearch-fe.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Mario Schuknecht 10 年之前
父節點
當前提交
acba23fec5
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      drivers/usb/gadget/function/f_fs.c

+ 3 - 3
drivers/usb/gadget/function/f_fs.c

@@ -1611,10 +1611,10 @@ static int ffs_epfiles_create(struct ffs_data *ffs)
 		mutex_init(&epfile->mutex);
 		mutex_init(&epfile->mutex);
 		init_waitqueue_head(&epfile->wait);
 		init_waitqueue_head(&epfile->wait);
 		if (ffs->user_flags & FUNCTIONFS_VIRTUAL_ADDR)
 		if (ffs->user_flags & FUNCTIONFS_VIRTUAL_ADDR)
-			sprintf(epfiles->name, "ep%02x", ffs->eps_addrmap[i]);
+			sprintf(epfile->name, "ep%02x", ffs->eps_addrmap[i]);
 		else
 		else
-			sprintf(epfiles->name, "ep%u", i);
-		epfile->dentry = ffs_sb_create_file(ffs->sb, epfiles->name,
+			sprintf(epfile->name, "ep%u", i);
+		epfile->dentry = ffs_sb_create_file(ffs->sb, epfile->name,
 						 epfile,
 						 epfile,
 						 &ffs_epfile_operations);
 						 &ffs_epfile_operations);
 		if (unlikely(!epfile->dentry)) {
 		if (unlikely(!epfile->dentry)) {