<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/leds, branch v4.19.77</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.19.77</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.19.77'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2019-10-05T11:09:45+00:00</updated>
<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>
<entry>
<title>leds: lp5523: fix a missing check of return value of lp55xx_read</title>
<updated>2019-02-27T09:08:57+00:00</updated>
<author>
<name>Kangjie Lu</name>
<email>kjlu@umn.edu</email>
</author>
<published>2018-12-26T04:18:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0761f58c62d70742a20d7a9ee0dfaf8a7eed1e9e'/>
<id>urn:sha1:0761f58c62d70742a20d7a9ee0dfaf8a7eed1e9e</id>
<content type='text'>
[ Upstream commit 248b57015f35c94d4eae2fdd8c6febf5cd703900 ]

When lp55xx_read() fails, "status" is an uninitialized variable and thus
may contain random value; using it leads to undefined behaviors.

The fix inserts a check for the return value of lp55xx_read: if it
fails, returns with its error code.

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 &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>leds: pwm: silently error out on EPROBE_DEFER</title>
<updated>2019-01-13T08:51:08+00:00</updated>
<author>
<name>Jerome Brunet</name>
<email>jbrunet@baylibre.com</email>
</author>
<published>2018-09-06T13:59:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eb05c02903a76c3bba0bd4eebe34fa684b0ca759'/>
<id>urn:sha1:eb05c02903a76c3bba0bd4eebe34fa684b0ca759</id>
<content type='text'>
commit 9aec30371fb095a0c9415f3f0146ae269c3713d8 upstream.

When probing, if we fail to get the pwm due to probe deferal, we shouldn't
print an error message. Just be silent in this case.

Signed-off-by: Jerome Brunet &lt;jbrunet@baylibre.com&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
Cc: Benjamin Drung &lt;bdrung@debian.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>leds: ns2: Change unsigned to unsigned int</title>
<updated>2018-08-06T21:03:12+00:00</updated>
<author>
<name>Kitone Elvis Peter</name>
<email>elviskitone@gmail.com</email>
</author>
<published>2018-08-06T17:27:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2224f2ff9670b899983ff1b42d85530e889cfea1'/>
<id>urn:sha1:2224f2ff9670b899983ff1b42d85530e889cfea1</id>
<content type='text'>
Use unsigned int, because it's preferred to unsigned.

Signed-off-by: Kitone Elvis Peter &lt;elviskitone@gmail.com&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
</content>
</entry>
<entry>
<title>leds: gpio trigger: simplifications from core changes</title>
<updated>2018-07-05T21:21:15+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2018-07-02T20:05:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9bfd7d9e5d63532da2d2d55a6bec5bb377761d37'/>
<id>urn:sha1:9bfd7d9e5d63532da2d2d55a6bec5bb377761d37</id>
<content type='text'>
The trigger core learned error handling for the activate callback and
to handle device attributes. Also make use of the module_led_trigger()
helper to simplify trigger registration.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
</content>
</entry>
</feed>
