Skip to content

Commit

Permalink
usb: musb: tusb6010: uninitialized data in tusb_fifo_write_unaligned()
Browse files Browse the repository at this point in the history
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: 550a737 ("USB: Add MUSB and TUSB support")
Signed-off-by: Dan Carpenter <[email protected]>
Cc: stable <[email protected]>
Link: https://lore.kernel.org/r/20210916135737.GI25094@kili
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Dan Carpenter authored and gregkh committed Sep 21, 2021
1 parent b55d37e commit 517c7bf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/musb/tusb6010.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 517c7bf

Please sign in to comment.