]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers-char-miscc-misc_register-do-not-loop-on-misc_list-unconditionally-fix
authorAndrew Morton <akpm@linux-foundation.org>
Wed, 20 Feb 2013 02:16:33 +0000 (13:16 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:53:57 +0000 (16:53 +1100)
reduce scope of local `c'

Cc: "Dae S. Kim" <dae@velatum.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Dae S. Kim <dae@velatum.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/char/misc.c

index 7b262b69c6532f893385238e0c837a43f8fbeb85..190d4423653f6b99690967ba3602915eda5463fb 100644 (file)
@@ -183,7 +183,6 @@ static const struct file_operations misc_fops = {
  
 int misc_register(struct miscdevice * misc)
 {
-       struct miscdevice *c;
        dev_t dev;
        int err = 0;
 
@@ -200,6 +199,8 @@ int misc_register(struct miscdevice * misc)
                misc->minor = DYNAMIC_MINORS - i - 1;
                set_bit(i, misc_minors);
        } else {
+               struct miscdevice *c;
+
                list_for_each_entry(c, &misc_list, list) {
                        if (c->minor == misc->minor) {
                                mutex_unlock(&misc_mtx);