]> git.baikalelectronics.ru Git - kernel.git/commit
fbtft: Fix the initialization from property algorithm
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 21 Nov 2019 14:02:07 +0000 (16:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Dec 2019 14:55:55 +0000 (15:55 +0100)
commit515770f0ad5d7cbf6111a2c2ea3d1a28e12343ce
treee4b01ab7fa70d6f837cba5c25f2a2cd6cae49c39
parentc2f270ac11c724d0d646ac9e6b88944cd888b007
fbtft: Fix the initialization from property algorithm

When converting to device property API the commit
38fbe8f7ccaa ("fbtft: Make use of device property API")
mistakenly placed the reading of the first value inside the loop,
that jumps over value after initialization sequence or sleep commands.

Move the above mentioned reading outside of the loop to restore
correct behaviour.

Besides that, we are using pre-increment operation which may lead to
out of the boundary access at the end of sequence. Thus, allocate buffer
with an additional element at the end to prevent out of the boundary
access.

Fixes: 38fbe8f7ccaa ("fbtft: Make use of device property API")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20191121140207.65089-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fbtft/fbtft-core.c