<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/hwmon, branch v4.9.293</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.293</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.293'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2021-11-26T10:48:34Z</updated>
<entry>
<title>hwmon: Fix possible memleak in __hwmon_device_register()</title>
<updated>2021-11-26T10:48:34Z</updated>
<author>
<name>Yang Yingliang</name>
<email>yangyingliang@huawei.com</email>
</author>
<published>2021-10-12T11:27:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c68a92435ac796f210d1c58839ec03dac2afa359'/>
<id>urn:sha1:c68a92435ac796f210d1c58839ec03dac2afa359</id>
<content type='text'>
[ Upstream commit ada61aa0b1184a8fda1a89a340c7d6cc4e59aee5 ]

I got memory leak as follows when doing fault injection test:

unreferenced object 0xffff888102740438 (size 8):
  comm "27", pid 859, jiffies 4295031351 (age 143.992s)
  hex dump (first 8 bytes):
    68 77 6d 6f 6e 30 00 00                          hwmon0..
  backtrace:
    [&lt;00000000544b5996&gt;] __kmalloc_track_caller+0x1a6/0x300
    [&lt;00000000df0d62b9&gt;] kvasprintf+0xad/0x140
    [&lt;00000000d3d2a3da&gt;] kvasprintf_const+0x62/0x190
    [&lt;000000005f8f0f29&gt;] kobject_set_name_vargs+0x56/0x140
    [&lt;00000000b739e4b9&gt;] dev_set_name+0xb0/0xe0
    [&lt;0000000095b69c25&gt;] __hwmon_device_register+0xf19/0x1e50 [hwmon]
    [&lt;00000000a7e65b52&gt;] hwmon_device_register_with_info+0xcb/0x110 [hwmon]
    [&lt;000000006f181e86&gt;] devm_hwmon_device_register_with_info+0x85/0x100 [hwmon]
    [&lt;0000000081bdc567&gt;] tmp421_probe+0x2d2/0x465 [tmp421]
    [&lt;00000000502cc3f8&gt;] i2c_device_probe+0x4e1/0xbb0
    [&lt;00000000f90bda3b&gt;] really_probe+0x285/0xc30
    [&lt;000000007eac7b77&gt;] __driver_probe_device+0x35f/0x4f0
    [&lt;000000004953d43d&gt;] driver_probe_device+0x4f/0x140
    [&lt;000000002ada2d41&gt;] __device_attach_driver+0x24c/0x330
    [&lt;00000000b3977977&gt;] bus_for_each_drv+0x15d/0x1e0
    [&lt;000000005bf2a8e3&gt;] __device_attach+0x267/0x410

When device_register() returns an error, the name allocated in
dev_set_name() will be leaked, the put_device() should be used
instead of calling hwmon_dev_release() to give up the device
reference, then the name will be freed in kobject_cleanup().

Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Fixes: bab2243ce189 ("hwmon: Introduce hwmon_device_register_with_groups")
Signed-off-by: Yang Yingliang &lt;yangyingliang@huawei.com&gt;
Link: https://lore.kernel.org/r/20211012112758.2681084-1-yangyingliang@huawei.com
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>hwmon: (pmbus/lm25066) Add offset coefficients</title>
<updated>2021-11-26T10:48:21Z</updated>
<author>
<name>Zev Weiss</name>
<email>zev@bewilderbeest.net</email>
</author>
<published>2021-09-28T09:22:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1ad9070df36d9fe9d1dbe721b4862cc9a17375c3'/>
<id>urn:sha1:1ad9070df36d9fe9d1dbe721b4862cc9a17375c3</id>
<content type='text'>
commit ae59dc455a78fb73034dd1fbb337d7e59c27cbd8 upstream.

With the exception of the lm5066i, all the devices handled by this
driver had been missing their offset ('b') coefficients for direct
format readings.

Cc: stable@vger.kernel.org
Fixes: 58615a94f6a1 ("hwmon: (pmbus/lm25066) Add support for LM25056")
Fixes: e53e6497fc9f ("hwmon: (pmbus/lm25066) Refactor device specific coefficients")
Signed-off-by: Zev Weiss &lt;zev@bewilderbeest.net&gt;
Link: https://lore.kernel.org/r/20210928092242.30036-2-zev@bewilderbeest.net
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>hwmon: (tmp421) fix rounding for negative values</title>
<updated>2021-10-06T08:23:41Z</updated>
<author>
<name>Paul Fertser</name>
<email>fercerpav@gmail.com</email>
</author>
<published>2021-09-24T09:30:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d7e1cad0124785d251ca3ef9222b317e1cec4377'/>
<id>urn:sha1:d7e1cad0124785d251ca3ef9222b317e1cec4377</id>
<content type='text'>
[ Upstream commit 724e8af85854c4d3401313b6dd7d79cf792d8990 ]

Old code produces -24999 for 0b1110011100000000 input in standard format due to
always rounding up rather than "away from zero".

Use the common macro for division, unify and simplify the conversion code along
the way.

Fixes: 9410700b881f ("hwmon: Add driver for Texas Instruments TMP421/422/423 sensor chips")
Signed-off-by: Paul Fertser &lt;fercerpav@gmail.com&gt;
Link: https://lore.kernel.org/r/20210924093011.26083-3-fercerpav@gmail.com
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>hwmon: (max31790) Fix fan speed reporting for fan7..12</title>
<updated>2021-07-20T14:21:01Z</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2021-05-26T15:40:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f1ee56e2938de714065c588889e6052ba1004d74'/>
<id>urn:sha1:f1ee56e2938de714065c588889e6052ba1004d74</id>
<content type='text'>
[ Upstream commit cbbf244f0515af3472084f22b6213121b4a63835 ]

Fans 7..12 do not have their own set of configuration registers.
So far the code ignored that and read beyond the end of the configuration
register range to get the tachometer period. This resulted in more or less
random fan speed values for those fans.

The datasheet is quite vague when it comes to defining the tachometer
period for fans 7..12. Experiments confirm that the period is the same
for both fans associated with a given set of configuration registers.

Fixes: 54187ff9d766 ("hwmon: (max31790) Convert to use new hwmon registration API")
Fixes: 195a4b4298a7 ("hwmon: Driver for Maxim MAX31790")
Cc: Jan Kundrát &lt;jan.kundrat@cesnet.cz&gt;
Reviewed-by: Jan Kundrát &lt;jan.kundrat@cesnet.cz&gt;
Cc: Václav Kubernát &lt;kubernat@cesnet.cz&gt;
Reviewed-by: Jan Kundrát &lt;jan.kundrat@cesnet.cz&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/20210526154022.3223012-2-linux@roeck-us.net
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>hwmon: (max31722) Remove non-standard ACPI device IDs</title>
<updated>2021-07-20T14:21:01Z</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2021-05-08T16:50:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e940b27e8efe679ef04ab8ae9e9423377ed6f112'/>
<id>urn:sha1:e940b27e8efe679ef04ab8ae9e9423377ed6f112</id>
<content type='text'>
[ Upstream commit 97387c2f06bcfd79d04a848d35517b32ee6dca7c ]

Valid Maxim Integrated ACPI device IDs would start with MXIM,
not with MAX1. On top of that, ACPI device IDs reflecting chip names
are almost always invalid.

Remove the invalid ACPI IDs.

Fixes: 04e1e70afec6 ("hwmon: (max31722) Add support for MAX31722/MAX31723 temperature sensors")
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Revert "hwmon: (lm80) fix a missing check of bus read in lm80 probe"</title>
<updated>2021-05-26T09:29:07Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2021-05-03T11:56:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d6f00b713f05cef1c776189eb90f950f6384ba2b'/>
<id>urn:sha1:d6f00b713f05cef1c776189eb90f950f6384ba2b</id>
<content type='text'>
commit 99ae3417672a6d4a3bf68d4fc43d7c6ca074d477 upstream.

This reverts commit 9aa3aa15f4c2f74f47afd6c5db4b420fadf3f315.

Because of recent interactions with developers from @umn.edu, all
commits from them have been recently re-reviewed to ensure if they were
correct or not.

Upon review, it was determined that this commit is not needed at all so
just revert it.  Also, the call to lm80_init_client() was not properly
handled, so if error handling is needed in the lm80_probe() function,
then it should be done properly, not half-baked like the commit being
reverted here did.

Cc: Kangjie Lu &lt;kjlu@umn.edu&gt;
Fixes: 9aa3aa15f4c2 ("hwmon: (lm80) fix a missing check of bus read in lm80 probe")
Cc: stable &lt;stable@vger.kernel.org&gt;
Acked-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/20210503115736.2104747-5-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>hwmon: (lm90) Fix max6658 sporadic wrong temperature reading</title>
<updated>2021-03-17T15:10:18Z</updated>
<author>
<name>Boyang Yu</name>
<email>byu@arista.com</email>
</author>
<published>2019-06-28T19:06:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4b8b728400cc500b2111de82288856646a429b28'/>
<id>urn:sha1:4b8b728400cc500b2111de82288856646a429b28</id>
<content type='text'>
commit 62456189f3292c62f87aef363f204886dc1d4b48 upstream.

max6658 may report unrealistically high temperature during
the driver initialization, for which, its overtemp alarm pin
also gets asserted. For certain devices implementing overtemp
protection based on that pin, it may further trigger a reset to
the device. By reproducing the problem, the wrong reading is
found to be coincident with changing the conversion rate.

To mitigate this issue, set the stop bit before changing the
conversion rate and unset it thereafter. After such change, the
wrong reading is not reproduced. Apply this change only to the
max6657 kind for now, controlled by flag LM90_PAUSE_ON_CONFIG.

Signed-off-by: Boyang Yu &lt;byu@arista.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Cc: Paul Menzel &lt;pmenzel@molgen.mpg.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>hwmon: (applesmc) check status earlier.</title>
<updated>2020-09-12T09:47:32Z</updated>
<author>
<name>Tom Rix</name>
<email>trix@redhat.com</email>
</author>
<published>2020-08-20T13:19:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ccf676d5103bcb02d83574b636af43fcccb74e80'/>
<id>urn:sha1:ccf676d5103bcb02d83574b636af43fcccb74e80</id>
<content type='text'>
[ Upstream commit cecf7560f00a8419396a2ed0f6e5d245ccb4feac ]

clang static analysis reports this representative problem

applesmc.c:758:10: warning: 1st function call argument is an
  uninitialized value
        left = be16_to_cpu(*(__be16 *)(buffer + 6)) &gt;&gt; 2;
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

buffer is filled by the earlier call

	ret = applesmc_read_key(LIGHT_SENSOR_LEFT_KEY, ...

This problem is reported because a goto skips the status check.
Other similar problems use data from applesmc_read_key before checking
the status.  So move the checks to before the use.

Signed-off-by: Tom Rix &lt;trix@redhat.com&gt;
Reviewed-by: Henrik Rydberg &lt;rydberg@bitmath.org&gt;
Link: https://lore.kernel.org/r/20200820131932.10590-1-trix@redhat.com
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>hwmon: (emc2103) fix unable to change fan pwm1_enable attribute</title>
<updated>2020-07-22T07:10:53Z</updated>
<author>
<name>Vishwas M</name>
<email>vishwas.reddy.vr@gmail.com</email>
</author>
<published>2020-07-07T14:27:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1b6a059e28c10bd8ec40baeb9cbc1d8e011c7588'/>
<id>urn:sha1:1b6a059e28c10bd8ec40baeb9cbc1d8e011c7588</id>
<content type='text'>
commit 14b0e83dc4f1e52b94acaeb85a18fd7fdd46d2dc upstream.

This patch fixes a bug which does not let FAN mode to be changed from
sysfs(pwm1_enable). i.e pwm1_enable can not be set to 3, it will always
remain at 0.

This is caused because the device driver handles the result of
"read_u8_from_i2c(client, REG_FAN_CONF1, &amp;conf_reg)" incorrectly. The
driver thinks an error has occurred if the (result != 0). This has been
fixed by changing the condition to (result &lt; 0).

Signed-off-by: Vishwas M &lt;vishwas.reddy.vr@gmail.com&gt;
Link: https://lore.kernel.org/r/20200707142747.118414-1-vishwas.reddy.vr@gmail.com
Fixes: 9df7305b5a86 ("hwmon: Add driver for SMSC EMC2103 temperature monitor and fan controller")
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>hwmon: (acpi_power_meter) Fix potential memory leak in acpi_power_meter_add()</title>
<updated>2020-07-09T07:35:56Z</updated>
<author>
<name>Misono Tomohiro</name>
<email>misono.tomohiro@jp.fujitsu.com</email>
</author>
<published>2020-06-25T04:32:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a56fe733f4b7db8d909faa23f82afdd23ea9822f'/>
<id>urn:sha1:a56fe733f4b7db8d909faa23f82afdd23ea9822f</id>
<content type='text'>
[ Upstream commit 8b97f9922211c44a739c5cbd9502ecbb9f17f6d1 ]

Although it rarely happens, we should call free_capabilities()
if error happens after read_capabilities() to free allocated strings.

Fixes: de584afa5e188 ("hwmon driver for ACPI 4.0 power meters")
Signed-off-by: Misono Tomohiro &lt;misono.tomohiro@jp.fujitsu.com&gt;
Link: https://lore.kernel.org/r/20200625043242.31175-1-misono.tomohiro@jp.fujitsu.com
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
