1. 01 6月, 2015 1 次提交
    • V
      char: misc: restore MISC_DYNAMIC_MINOR on device_create() failure · b575f712
      Vladimir Zapolskiy 提交于
      On attempt to register a dynamic minor misc device its minor number is
      updated to a virtual minor number prior to device_create() call,
      however on error path misc->minor == MISC_DYNAMIC_MINOR is not
      restored.
      
      Following the rule of thumb that a function returning an error must
      not change the state of the caller, assign MISC_DYNAMIC_MINOR back.
      
      The problem is met in a sutuation, when subsys_initcall(misc_init) is
      not yet called and misc_class is not created, but misc_register()
      modifies statically defined ".minor = MISC_DYNAMIC_MINOR", therefore
      implicitly changing the client's logic on next attempt (e.g. retrying
      from deferred list) to register a misc device, whose minor number is
      converted from dynamic to some unknown static one.
      Signed-off-by: NVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b575f712
  2. 31 5月, 2015 1 次提交
  3. 25 5月, 2015 38 次提交