From: Alex Dewar <alex.dewar90@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Alex Dewar <alex.dewar90@gmail.com>,
devel@driverdev.osuosl.org,
Saiyam Doshi <saiyamdoshi.in@gmail.com>,
Magnus Damm <damm+renesas@opensource.se>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
YueHaibing <yuehaibing@huawei.com>,
linux-kernel@vger.kernel.org,
"Javier F. Arias" <jarias.linux@gmail.com>,
"Frank A. Cancio Bello" <frank@generalsoftwareinc.com>,
Simon Horman <horms+renesas@verge.net.au>
Subject: Re: [PATCH] staging: emxx_udc: Fix passing of NULL to dma_alloc_coherent()
Date: Tue, 25 Aug 2020 09:14:59 +0100 [thread overview]
Message-ID: <20200825081459.qfvswtep5fkaqai2@lenovo-laptop> (raw)
In-Reply-To: <20200825073713.GR1793@kadam>
On Tue, Aug 25, 2020 at 10:37:13AM +0300, Dan Carpenter wrote:
> On Mon, Aug 24, 2020 at 04:57:12PM +0100, Alex Dewar wrote:
> > On Mon, Aug 24, 2020 at 04:19:17PM +0100, Alex Dewar wrote:
> > > In nbu2ss_eq_queue() memory is allocated with dma_alloc_coherent(),
> > > though, strangely, NULL is passed as the struct device* argument. Pass
> > > the UDC's device instead.
>
> I think passing NULL was always wrong, but it used to not cause an Oops.
> This was changed a year or two ago.
>
> > >
> > > Build-tested on x86 only.
> > >
> > > Fixes: 33aa8d45a4fe ("staging: emxx_udc: Add Emma Mobile USB Gadget driver")
> > > Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
> > > ---
> > >
> > > So I *think* this is the right fix, but I don't have the hardware so
> > > I've only been able to build-test it. My worry is that I could be
> > > passing in the wrong struct device* here, which would squelch the
> > > warning without fixing the breakage.
> > >
> > > Can someone cleverer than me tell me if this makes sense?
> > >
> > > - Alex
> >
> > PS -- I meant to put an RFC in the subject line and an extra tag:
> > Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
>
> I don't know which dev pointer we're supposed to pass... It would be
> good to find someone to test the patch but if not then applying your
> patch is reasonable.
>
> But could you search through the file and update the rest as well.
> The dma_free_coherent() needs to be updated and there was a second
> dma_alloc_coherent() in the bug report.
>
> regards,
> dan carpenter
>
I can only find the one instance of dma_alloc_coherent(). Was it by any
chance a different warning about the same call....?
next prev parent reply other threads:[~2020-08-25 8:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200824142118.GA223827@mwanda>
2020-08-24 15:19 ` [PATCH] staging: emxx_udc: Fix passing of NULL to dma_alloc_coherent() Alex Dewar
2020-08-24 15:57 ` Alex Dewar
2020-08-25 7:37 ` Dan Carpenter
2020-08-25 8:14 ` Alex Dewar [this message]
2020-08-25 8:28 ` Dan Carpenter
2020-08-25 9:19 ` [PATCH v2] " Alex Dewar
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=20200825081459.qfvswtep5fkaqai2@lenovo-laptop \
--to=alex.dewar90@gmail.com \
--cc=damm+renesas@opensource.se \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=frank@generalsoftwareinc.com \
--cc=gregkh@linuxfoundation.org \
--cc=horms+renesas@verge.net.au \
--cc=jarias.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=saiyamdoshi.in@gmail.com \
--cc=yuehaibing@huawei.com \
/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;
as well as URLs for NNTP newsgroup(s).