Thread (3 messages) 3 messages, 3 authors, 2026-06-26

Re: [PATCH] staging: fbtft: fix unaligned access and buffer size when startbyte is used

From: Andy Shevchenko <hidden>
Date: 2026-06-25 14:08:18
Also in: dri-devel, linux-staging, lkml

On Thu, Jun 25, 2026 at 06:30:41PM +0800, suryasaimadhu wrote:
When par->startbyte is non-zero, buf is advanced by one byte creating
an unaligned pointer for 16-bit types (u16, __be16). Dereferencing this
unaligned pointer can cause a kernel panic on strict-alignment
architectures.

Fix by using put_unaligned() instead of direct pointer dereference.

Also fix incorrect buffer size calculation in fbtft_write_buf_dc() call:
  len * (sizeof(data_type) + offset)  /* wrong: multiplies offset by len */
  len * sizeof(data_type) + offset    /* correct: one startbyte +
                                         len items */
Same comments as per your other patch contributions. Make it cleaner next time.
So it seem a v2 should be a mini-series with fixes for different
issues/drivers/et cetera.

-- 
With Best Regards,
Andy Shevchenko

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help