1. 03 Sep, 2019 7 commits
  2. 31 Aug, 2019 3 commits
    • Wenwen Wang's avatar
      hwmon (coretemp) Fix a memory leak bug · e027a2de
      Wenwen Wang authored
      In coretemp_init(), 'zone_devices' is allocated through kcalloc().
      However, it is not deallocated in the following execution if
      platform_driver_register() fails, leading to a memory leak. To fix this
      issue, introduce the 'outzone' label to free 'zone_devices' before
      returning the error.
      Signed-off-by: default avatarWenwen Wang <wenwen@cs.uga.edu>
      Link: https://lore.kernel.org/r/1566248402-6538-1-git-send-email-wenwen@cs.uga.eduSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      e027a2de
    • Guenter Roeck's avatar
      hwmon: (lm75) Fix write operations for negative temperatures · 7d82fcc9
      Guenter Roeck authored
      Writes into limit registers fail if the temperature written is negative.
      The regmap write operation checks the value range, regmap_write accepts
      an unsigned int as parameter, and the temperature value passed to
      regmap_write is kept in a variable declared as long. Negative values
      are converted large unsigned integers, which fails the range check.
      Fix by type casting the temperature to u16 when calling regmap_write().
      
      Cc: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk>
      Fixes: e65365fe ("hwmon: (lm75) Convert to use regmap")
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      7d82fcc9
    • Bartosz Golaszewski's avatar
      hwmon: pmbus: ucd9000: remove unneeded include · 6f8c8f3c
      Bartosz Golaszewski authored
      Build bot reports the following build issue after commit 9091373a
      ("gpio: remove less important #ifdef around declarations):
      
         In file included from drivers/hwmon/pmbus/ucd9000.c:19:0:
      >> include/linux/gpio/driver.h:576:1: error: redefinition of 'gpiochip_add_pin_range'
          gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
          ^~~~~~~~~~~~~~~~~~~~~~
         In file included from drivers/hwmon/pmbus/ucd9000.c:18:0:
         include/linux/gpio.h:245:1: note: previous definition of 'gpiochip_add_pin_range' was here
          gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
          ^~~~~~~~~~~~~~~~~~~~~~
         In file included from drivers/hwmon/pmbus/ucd9000.c:19:0:
      >> include/linux/gpio/driver.h:583:1: error: redefinition of 'gpiochip_add_pingroup_range'
          gpiochip_add_pingroup_range(struct gpio_chip *chip,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
         In file included from drivers/hwmon/pmbus/ucd9000.c:18:0:
         include/linux/gpio.h:254:1: note: previous definition of 'gpiochip_add_pingroup_range' was here
          gpiochip_add_pingroup_range(struct gpio_chip *chip,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
         In file included from drivers/hwmon/pmbus/ucd9000.c:19:0:
      >> include/linux/gpio/driver.h:591:1: error: redefinition of 'gpiochip_remove_pin_ranges'
          gpiochip_remove_pin_ranges(struct gpio_chip *chip)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~
         In file included from drivers/hwmon/pmbus/ucd9000.c:18:0:
         include/linux/gpio.h:263:1: note: previous definition of 'gpiochip_remove_pin_ranges' was here
          gpiochip_remove_pin_ranges(struct gpio_chip *chip)
      
      This is caused by conflicting defines from linux/gpio.h and
      linux/gpio/driver.h. Drivers should not include both the legacy and
      the new API headers. This driver doesn't even use linux/gpio.h so
      remove it.
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
      Link: https://lore.kernel.org/r/20190808080144.6183-1-brgl@bgdev.plSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      6f8c8f3c
  3. 25 Aug, 2019 22 commits
  4. 24 Aug, 2019 8 commits