From: Dan Carpenter Date: Thu, 16 Sep 2021 13:57:37 +0000 (+0300) Subject: usb: musb: tusb6010: uninitialized data in tusb_fifo_write_unaligned() X-Git-Tag: v5.15~190^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=517c7bf99bad3d6b9360558414aae634b7472d80;p=platform%2Fkernel%2Flinux-starfive.git usb: musb: tusb6010: uninitialized data in tusb_fifo_write_unaligned() This is writing to the first 1 - 3 bytes of "val" and then writing all four bytes to musb_writel(). The last byte is always going to be garbage. Zero out the last bytes instead. Fixes: 550a7375fe72 ("USB: Add MUSB and TUSB support") Signed-off-by: Dan Carpenter Cc: stable Link: https://lore.kernel.org/r/20210916135737.GI25094@kili Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index c429376..c968ecd 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -190,6 +190,7 @@ tusb_fifo_write_unaligned(void __iomem *fifo, const u8 *buf, u16 len) } if (len > 0) { /* Write the rest 1 - 3 bytes to FIFO */ + val = 0; memcpy(&val, buf, len); musb_writel(fifo, 0, val); }