1. 12 5月, 2015 8 次提交
  2. 30 4月, 2015 1 次提交
    • J
      gpio: sysfs: fix memory leaks and device hotplug · 483d8211
      Johan Hovold 提交于
      Unregister GPIOs requested through sysfs at chip remove to avoid leaking
      the associated memory and sysfs entries.
      
      The stale sysfs entries prevented the gpio numbers from being exported
      when the gpio range was later reused (e.g. at device reconnect).
      
      This also fixes the related module-reference leak.
      
      Note that kernfs makes sure that any on-going sysfs operations finish
      before the class devices are unregistered and that further accesses
      fail.
      
      The chip exported flag is used to prevent gpiod exports during removal.
      This also makes it harder to trigger, but does not fix, the related race
      between gpiochip_remove and export_store, which is really a race with
      gpiod_request that needs to be addressed separately.
      
      Also note that this would prevent the crashes (e.g. NULL-dereferences)
      at reconnect that affects pre-3.18 kernels, as well as use-after-free on
      operations on open attribute files on pre-3.14 kernels (prior to
      kernfs).
      
      Fixes: d8f388d8 ("gpio: sysfs interface")
      Cc: stable <stable@vger.kernel.org>	# v2.6.27: 01cca93aSigned-off-by: NJohan Hovold <johan@kernel.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      483d8211
  3. 30 1月, 2015 2 次提交
  4. 16 1月, 2015 3 次提交
  5. 28 11月, 2014 1 次提交
  6. 29 10月, 2014 1 次提交
  7. 24 7月, 2014 1 次提交
  8. 23 7月, 2014 2 次提交
  9. 09 7月, 2014 1 次提交
    • A
      gpio: move sysfs support to its own file · 0eb4c6c2
      Alexandre Courbot 提交于
      sysfs support is currently entangled within the core GPIO support, while
      it should relly just be a (privileged) user of the integer GPIO API.
      This patch is a first step towards making the gpiolib code more readable
      by splitting it into logical parts.
      
      Move all sysfs support to their own source file, and share static
      members of gpiolib that need to be in the private gpiolib.h file. In
      the future we will want to put some of them back into gpiolib.c, but this
      first patch let us at least identify them.
      Signed-off-by: NAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      0eb4c6c2