Revision d717ea73e36dd5659640fae82605ad85c4117f4d authored by Geert Uytterhoeven on 13 August 2014, 15:18:53 UTC, committed by Thierry Reding on 18 August 2014, 08:58:43 UTC
If pwm_get() finds a look-up entry with a perfect match (both dev_id and con_id match), the loop is aborted, and "p" still points to the correct struct pwm_lookup. If only an entry with a matching dev_id or con_id is found, the loop terminates after traversing the whole list, and "p" now points to arbitrary memory, not part of the pwm_lookup list. Then pwm_set_period() and pwm_set_polarity() will set random values for period resp. polarity. To fix this, save period and polarity when finding a new best match, just like is done for chip (for the provider) and index. This fixes the LCD backlight on r8a7740/armadillo-legacy, which was fed period 0 and polarity -1068821144 instead of 33333 resp. 1. Fixes: 3796ce1d4d4b ("pwm: add period and polarity to struct pwm_lookup") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Cc: stable@vger.kernel.org Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
1 parent 7d1311b
File | Mode | Size |
---|---|---|
Kconfig | -rw-r--r-- | 1.7 KB |
Makefile | -rw-r--r-- | 241 bytes |
balloc.c | -rw-r--r-- | 26.8 KB |
cylinder.c | -rw-r--r-- | 5.7 KB |
dir.c | -rw-r--r-- | 16.1 KB |
file.c | -rw-r--r-- | 1014 bytes |
ialloc.c | -rw-r--r-- | 9.0 KB |
inode.c | -rw-r--r-- | 25.2 KB |
namei.c | -rw-r--r-- | 7.3 KB |
super.c | -rw-r--r-- | 43.4 KB |
swab.h | -rw-r--r-- | 2.5 KB |
symlink.c | -rw-r--r-- | 1.2 KB |
truncate.c | -rw-r--r-- | 12.7 KB |
ufs.h | -rw-r--r-- | 5.4 KB |
ufs_fs.h | -rw-r--r-- | 34.6 KB |
util.c | -rw-r--r-- | 6.0 KB |
util.h | -rw-r--r-- | 16.4 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...