1. 27 8月, 2011 2 次提交
    • T
      rtc: twl: Fix registration vs. init order · 7e72c686
      Todd Poynor 提交于
      Only register as an RTC device after the hardware has been
      successfully initialized.  The RTC class driver will call
      back to this driver to read a pending alarm, and other
      drivers watching for new devices on the RTC class may
      read the RTC time upon registration.  Such access might
      occur while the RTC is stopped, prior to clearing
      pending alarms, etc.
      
      The new ordering also avoids leaving the platform
      device drvdata set to an unregistered struct rtc_device *
      on probe errors.
      Signed-off-by: NTodd Poynor <toddpoynor@google.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      7e72c686
    • M
      rtc: Initialized rtc_time->tm_isdst · a7402deb
      Mike Waychison 提交于
      Even though the Linux kernel does not use the tm_isdst field, it is
      exposed as part of the ABI.  This field can accidentally be left
      initialized, which is why we currently memset buffers returned to
      userland in rtc_read_time.
      
      There is a case however where the field can return garbage from the
      stack though when using the RTC_ALM_READ ioctl on the rtc device.  This
      ioctl invokes rtc_read_alarm, which is careful to memset the rtc_wkalrm
      buffer that is copied to userland, but it then uses a struct copy to
      assign to alarm->time given the return value from rtc_ktime_to_tm().
      
      rtc_ktime_to_tm() is implemented by calling rtc_time_to_tm using a
      derivative seconds counds from ktime, but rtc_time_to_tm does not assign
      a value to ->tm_isdst.  This results in garbage from rtc_ktime_to_tm()'s
      frame ending up being copied out to userland as part of the returned
      rtc_wkalrm.
      
      Fix this by initializing rtc_time->tm_isdst to 0 in rtc_time_to_tm.
      Signed-off-by: NMike Waychison <mikew@google.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      a7402deb
  2. 11 8月, 2011 4 次提交
  3. 08 8月, 2011 1 次提交
  4. 07 8月, 2011 2 次提交
  5. 06 8月, 2011 31 次提交