public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Bin Liu <b-liu@ti.com>, Felipe Balbi <felipe.balbi@nokia.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] usb: musb: tusb6010: uninitialized data in tusb_fifo_write_unaligned()
Date: Thu, 16 Sep 2021 10:46:04 +0300	[thread overview]
Message-ID: <20210916074604.GG2088@kadam> (raw)
In-Reply-To: <e3ce24c3-477f-5a55-a89a-a0cdff564d8e@wanadoo.fr>

On Wed, Sep 15, 2021 at 07:49:40PM +0200, Christophe JAILLET wrote:
> Le 15/09/2021 à 12:36, Dan Carpenter a écrit :
> > This is writing to the first 1 - 3 bytes of "len" 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 <dan.carpenter@oracle.com>
> > ---
> >   drivers/usb/musb/tusb6010.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
> > index c42937692207..c510fb84faa6 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 */
> > +		len = 0;
> 
> +		val = 0;
> ?

Wow.  Duh!  My goodness...

Thanks for catching that.

regards,
dan carpenter


      reply	other threads:[~2021-09-16  7:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15 10:36 [PATCH] usb: musb: tusb6010: uninitialized data in tusb_fifo_write_unaligned() Dan Carpenter
2021-09-15 17:49 ` Christophe JAILLET
2021-09-16  7:46   ` Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210916074604.GG2088@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=b-liu@ti.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=felipe.balbi@nokia.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox