public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: FunctionFS: Fix missing braces in parse_opts
@ 2013-01-09  3:57 Benoit Goby
  2013-01-09  8:08 ` Michal Nazarewicz
  2013-01-09  9:17 ` [PATCH 1/2] usb: gadget: FunctionFS: Use kstrtoul() Michal Nazarewicz
  0 siblings, 2 replies; 4+ messages in thread
From: Benoit Goby @ 2013-01-09  3:57 UTC (permalink / raw)
  To: linux-usb, linux-kernel; +Cc: Felipe Balbi, Greg Kroah-Hartman, Benoit Goby

Add missing braces around an if block in ffs_fs_parse_opts. This broke
parsing the uid/gid mount options and causes mount to fail when using
uid/gid. This has been introduced by commit b9b73f7c (userns: Convert usb
functionfs to use kuid/kgid where appropriate) in 3.7.

Signed-off-by: Benoit Goby <benoit@android.com>
---
 drivers/usb/gadget/f_fs.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
index 4a6961c..8c2f251 100644
--- a/drivers/usb/gadget/f_fs.c
+++ b/drivers/usb/gadget/f_fs.c
@@ -1153,15 +1153,15 @@ static int ffs_fs_parse_opts(struct ffs_sb_fill_data *data, char *opts)
 					pr_err("%s: unmapped value: %lu\n", opts, value);
 					return -EINVAL;
 				}
-			}
-			else if (!memcmp(opts, "gid", 3))
+			} else if (!memcmp(opts, "gid", 3)) {
 				data->perms.gid = make_kgid(current_user_ns(), value);
 				if (!gid_valid(data->perms.gid)) {
 					pr_err("%s: unmapped value: %lu\n", opts, value);
 					return -EINVAL;
 				}
-			else
+			} else {
 				goto invalid;
+			}
 			break;
 
 		default:
-- 
1.7.7.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-09  9:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-09  3:57 [PATCH] usb: gadget: FunctionFS: Fix missing braces in parse_opts Benoit Goby
2013-01-09  8:08 ` Michal Nazarewicz
2013-01-09  9:17 ` [PATCH 1/2] usb: gadget: FunctionFS: Use kstrtoul() Michal Nazarewicz
2013-01-09  9:17   ` [PATCH 2/2] usb: gadget: FunctionFS: Refactor option parsing Michal Nazarewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox