<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/leds, branch v4.19.112</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.19.112</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.19.112'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-02-24T07:34:35+00:00</updated>
<entry>
<title>leds: pca963x: Fix open-drain initialization</title>
<updated>2020-02-24T07:34:35+00:00</updated>
<author>
<name>Zahari Petkov</name>
<email>zahari@balena.io</email>
</author>
<published>2019-11-18T21:02:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=44d748f2abda27c6a7efc5cb3dccd9ed56a61c45'/>
<id>urn:sha1:44d748f2abda27c6a7efc5cb3dccd9ed56a61c45</id>
<content type='text'>
[ Upstream commit 697529091ac7a0a90ca349b914bb30641c13c753 ]

Before commit bb29b9cccd95 ("leds: pca963x: Add bindings to invert
polarity") Mode register 2 was initialized directly with either 0x01
or 0x05 for open-drain or totem pole (push-pull) configuration.

Afterwards, MODE2 initialization started using bitwise operations on
top of the default MODE2 register value (0x05). Using bitwise OR for
setting OUTDRV with 0x01 and 0x05 does not produce correct results.
When open-drain is used, instead of setting OUTDRV to 0, the driver
keeps it as 1:

Open-drain: 0x05 | 0x01 -&gt; 0x05 (0b101 - incorrect)
Totem pole: 0x05 | 0x05 -&gt; 0x05 (0b101 - correct but still wrong)

Now OUTDRV setting uses correct bitwise operations for initialization:

Open-drain: 0x05 &amp; ~0x04 -&gt; 0x01 (0b001 - correct)
Totem pole: 0x05 | 0x04 -&gt; 0x05 (0b101 - correct)

Additional MODE2 register definitions are introduced now as well.

Fixes: bb29b9cccd95 ("leds: pca963x: Add bindings to invert polarity")
Signed-off-by: Zahari Petkov &lt;zahari@balena.io&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>led: triggers: Fix dereferencing of null pointer</title>
<updated>2020-01-27T13:51:10+00:00</updated>
<author>
<name>Oleh Kravchenko</name>
<email>oleg@kaa.org.ua</email>
</author>
<published>2019-09-03T21:18:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b6a99e96125a4bb7b1235eb73b6f1166a21b10b0'/>
<id>urn:sha1:b6a99e96125a4bb7b1235eb73b6f1166a21b10b0</id>
<content type='text'>
[ Upstream commit 4016ba85880b252365d11bc7dc899450f2c73ad7 ]

Error was detected by PVS-Studio:
V522 Dereferencing of the null pointer 'led_cdev-&gt;trigger' might take place.

Fixes: 2282e125a406 ("leds: triggers: let struct led_trigger::activate() return an error code")
Signed-off-by: Oleh Kravchenko &lt;oleg@kaa.org.ua&gt;
Reviewed-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>leds: lm3692x: Handle failure to probe the regulator</title>
<updated>2020-01-04T18:12:43+00:00</updated>
<author>
<name>Guido Günther</name>
<email>agx@sigxcpu.org</email>
</author>
<published>2019-09-21T21:12:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a072f0ab35d213e4471a6c93e61d0b4a1b46dc05'/>
<id>urn:sha1:a072f0ab35d213e4471a6c93e61d0b4a1b46dc05</id>
<content type='text'>
[ Upstream commit 396128d2ffcba6e1954cfdc9a89293ff79cbfd7c ]

Instead use devm_regulator_get_optional since the regulator
is optional and check for errors.

Signed-off-by: Guido Günther &lt;agx@sigxcpu.org&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Reviewed-by: Dan Murphy &lt;dmurphy@ti.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>leds: trigger: netdev: fix handling on interface rename</title>
<updated>2019-12-17T19:35:54+00:00</updated>
<author>
<name>Martin Schiller</name>
<email>ms@dev.tdt.de</email>
</author>
<published>2019-10-25T07:01:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f1fd9d0bfd925afb58c496bd7cb3b24545349ff1'/>
<id>urn:sha1:f1fd9d0bfd925afb58c496bd7cb3b24545349ff1</id>
<content type='text'>
[ Upstream commit 5f820ed52371b4f5d8c43c93f03408d0dbc01e5b ]

The NETDEV_CHANGENAME code is not "unneeded" like it is stated in commit
4cb6560514fa ("leds: trigger: netdev: fix refcnt leak on interface
rename").

The event was accidentally misinterpreted equivalent to
NETDEV_UNREGISTER, but should be equivalent to NETDEV_REGISTER.

This was the case in the original code from the openwrt project.

Otherwise, you are unable to set netdev led triggers for (non-existent)
netdevices, which has to be renamed. This is the case, for example, for
ppp interfaces in openwrt.

Fixes: 06f502f57d0d ("leds: trigger: Introduce a NETDEV trigger")
Fixes: 4cb6560514fa ("leds: trigger: netdev: fix refcnt leak on interface rename")
Signed-off-by: Martin Schiller &lt;ms@dev.tdt.de&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>led: triggers: Fix a memory leak bug</title>
<updated>2019-10-05T11:09:45+00:00</updated>
<author>
<name>Wenwen Wang</name>
<email>wenwen@cs.uga.edu</email>
</author>
<published>2019-08-19T20:41:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e497ec26cc4394624ee90607e7497ad9665c2d86'/>
<id>urn:sha1:e497ec26cc4394624ee90607e7497ad9665c2d86</id>
<content type='text'>
[ Upstream commit 60e2dde1e91ae0addb21ac380cc36ebee7534e49 ]

In led_trigger_set(), 'event' is allocated in kasprintf(). However, it is
not deallocated in the following execution if the label 'err_activate' or
'err_add_groups' is entered, leading to memory leaks. To fix this issue,
free 'event' before returning the error.

Fixes: 52c47742f79d ("leds: triggers: send uevent when changing triggers")
Signed-off-by: Wenwen Wang &lt;wenwen@cs.uga.edu&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>leds: leds-lp5562 allow firmware files up to the maximum length</title>
<updated>2019-10-05T11:09:34+00:00</updated>
<author>
<name>Nick Stoughton</name>
<email>nstoughton@logitech.com</email>
</author>
<published>2019-07-17T21:56:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8f9dc49928c2fe0e5d4eeab237b76abde1f46e56'/>
<id>urn:sha1:8f9dc49928c2fe0e5d4eeab237b76abde1f46e56</id>
<content type='text'>
[ Upstream commit ed2abfebb041473092b41527903f93390d38afa7 ]

Firmware files are in ASCII, using 2 hex characters per byte. The
maximum length of a firmware string is therefore

16 (commands) * 2 (bytes per command) * 2 (characters per byte) = 64

Fixes: ff45262a85db ("leds: add new LP5562 LED driver")
Signed-off-by: Nick Stoughton &lt;nstoughton@logitech.com&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>leds: trigger: netdev: use memcpy in device_name_store</title>
<updated>2019-05-04T07:20:22+00:00</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2019-03-14T14:06:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ee096f0dc4a44a3d6cae27dce87abeea71b4680f'/>
<id>urn:sha1:ee096f0dc4a44a3d6cae27dce87abeea71b4680f</id>
<content type='text'>
[ Upstream commit 909346433064b8d840dc82af26161926b8d37558 ]

If userspace doesn't end the input with a newline (which can easily
happen if the write happens from a C program that does write(fd,
iface, strlen(iface))), we may end up including garbage from a
previous, longer value in the device_name. For example

# cat device_name

# printf 'eth12' &gt; device_name
# cat device_name
eth12
# printf 'eth3' &gt; device_name
# cat device_name
eth32

I highly doubt anybody is relying on this behaviour, so switch to
simply copying the bytes (we've already checked that size is &lt;
IFNAMSIZ) and unconditionally zero-terminate it; of course, we also
still have to strip a trailing newline.

This is also preparation for future patches.

Fixes: 06f502f57d0d ("leds: trigger: Introduce a NETDEV trigger")
Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
Signed-off-by: Sasha Levin (Microsoft) &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>leds: pca9532: fix a potential NULL pointer dereference</title>
<updated>2019-05-04T07:20:22+00:00</updated>
<author>
<name>Kangjie Lu</name>
<email>kjlu@umn.edu</email>
</author>
<published>2019-03-09T06:04:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2663959af22c485a5ee662f8189075912e3280b3'/>
<id>urn:sha1:2663959af22c485a5ee662f8189075912e3280b3</id>
<content type='text'>
[ Upstream commit 0aab8e4df4702b31314a27ec4b0631dfad0fae0a ]

In case of_match_device cannot find a match, return -EINVAL to avoid
NULL pointer dereference.

Fixes: fa4191a609f2 ("leds: pca9532: Add device tree support")
Signed-off-by: Kangjie Lu &lt;kjlu@umn.edu&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
Signed-off-by: Sasha Levin (Microsoft) &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>leds: trigger: netdev: fix refcnt leak on interface rename</title>
<updated>2019-05-04T07:20:21+00:00</updated>
<author>
<name>Rafał Miłecki</name>
<email>rafal@milecki.pl</email>
</author>
<published>2019-02-28T21:57:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=04cac1dce92380a78e1b908cb625ab25d123ade4'/>
<id>urn:sha1:04cac1dce92380a78e1b908cb625ab25d123ade4</id>
<content type='text'>
[ Upstream commit 4cb6560514fa19d556954b88128f3846fee66a03 ]

Renaming a netdev-trigger-tracked interface was resulting in an
unbalanced dev_hold().

Example:
&gt; iw phy phy0 interface add foo type __ap
&gt; echo netdev &gt; trigger
&gt; echo foo &gt; device_name
&gt; ip link set foo name bar
&gt; iw dev bar del
[  237.355366] unregister_netdevice: waiting for bar to become free. Usage count = 1
[  247.435362] unregister_netdevice: waiting for bar to become free. Usage count = 1
[  257.545366] unregister_netdevice: waiting for bar to become free. Usage count = 1

Above problem was caused by trigger checking a dev-&gt;name which obviously
changes after renaming an interface. It meant missing all further events
including the NETDEV_UNREGISTER which is required for calling dev_put().

This change fixes that by:
1) Comparing device struct *address* for notification-filtering purposes
2) Dropping unneeded NETDEV_CHANGENAME code (no behavior change)

Fixes: 06f502f57d0d ("leds: trigger: Introduce a NETDEV trigger")
Signed-off-by: Rafał Miłecki &lt;rafal@milecki.pl&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
Signed-off-by: Sasha Levin (Microsoft) &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>leds: lp55xx: fix null deref on firmware load failure</title>
<updated>2019-04-05T20:33:07+00:00</updated>
<author>
<name>Michal Kazior</name>
<email>michal@plume.com</email>
</author>
<published>2019-02-11T09:29:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5658279f50eaedf607f07750b99e9d41103ba7b5'/>
<id>urn:sha1:5658279f50eaedf607f07750b99e9d41103ba7b5</id>
<content type='text'>
[ Upstream commit 5ddb0869bfc1bca6cfc592c74c64a026f936638c ]

I've stumbled upon a kernel crash and the logs
pointed me towards the lp5562 driver:

&gt; &lt;4&gt;[306013.841294] lp5562 0-0030: Direct firmware load for lp5562 failed with error -2
&gt; &lt;4&gt;[306013.894990] lp5562 0-0030: Falling back to user helper
&gt; ...
&gt; &lt;3&gt;[306073.924886] lp5562 0-0030: firmware request failed
&gt; &lt;1&gt;[306073.939456] Unable to handle kernel NULL pointer dereference at virtual address 00000000
&gt; &lt;4&gt;[306074.251011] PC is at _raw_spin_lock+0x1c/0x58
&gt; &lt;4&gt;[306074.255539] LR is at release_firmware+0x6c/0x138
&gt; ...

After taking a look I noticed firmware_release()
could be called with either NULL or a dangling
pointer.

Fixes: 10c06d178df11 ("leds-lp55xx: support firmware interface")
Signed-off-by: Michal Kazior &lt;michal@plume.com&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
