1. 17 Feb, 2019 5 commits
  2. 11 Feb, 2019 3 commits
  3. 08 Feb, 2019 4 commits
  4. 07 Feb, 2019 6 commits
  5. 05 Feb, 2019 3 commits
  6. 30 Jan, 2019 2 commits
  7. 23 Jan, 2019 1 commit
  8. 22 Jan, 2019 14 commits
  9. 10 Jan, 2019 2 commits
    • Trent Piepho's avatar
      rtc: isl1208: fix negative digital trim reporting · c8c97a4f
      Trent Piepho authored
      isl1208_i2c_get_dtr() was returning the dtr value directly, but could
      also return a negative error code.  Negative trimming values, e.g. -20,
      would get interpreted as an error code, e.g. -ENOTDIR.
      
      This patch offsets the dtr value by 100 so it's positive and won't alias
      an error code.
      
      Also fix check that considered a return value of -1 to be success.
      
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
      Signed-off-by: default avatarTrent Piepho <tpiepho@impinj.com>
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      c8c97a4f
    • ZhangXiaoxu's avatar
      rtc: Fix UBSAN overflow warning · 074b01a5
      ZhangXiaoxu authored
      Users may call 'ioctl' and pass a very big value on 'tm->tm_year'.
      It can be overflowed in 'int' after add 1900.
      In function 'rtc_month_days' and 'mktime64', also treated it as an
      'unsigned' parameter.
      
      UBSAN: Undefined behaviour in drivers/rtc/rtc-lib.c:103:59
      signed integer overflow:
      2147483647 + 1900 cannot be represented in type 'int'
      
      UBSAN: Undefined behaviour in drivers/rtc/rtc-lib.c:119:30
      signed integer overflow:
      2147483647 + 1900 cannot be represented in type 'int'
      
      So, covert it to 'unsigned' explicitly.
      Signed-off-by: default avatarZhangXiaoxu <zhangxiaoxu5@huawei.com>
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      074b01a5