[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190207160227.GA17445@ulmo>
Date: Thu, 7 Feb 2019 17:02:27 +0100
From: Thierry Reding <thierry.reding@...il.com>
To: Sowjanya Komatineni <skomatineni@...dia.com>
Cc: Dmitry Osipenko <digetx@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Mantravadi Karthik <mkarthik@...dia.com>,
Shardar Mohammed <smohammed@...dia.com>,
Timo Alho <talho@...dia.com>,
"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>
Subject: Re: [PATCH V14 3/5] i2c: tegra: Add DMA support
On Thu, Feb 07, 2019 at 03:11:06PM +0000, Sowjanya Komatineni wrote:
> >
> >
> > > @@ -1124,6 +1453,10 @@ static int tegra_i2c_probe(struct platform_device *pdev)
> > > }
> > > }
> > >
> > > + ret = tegra_i2c_init_dma(i2c_dev);
> > > + if (ret < 0)
> > > + goto disable_div_clk;
> > > +
> > > ret = tegra_i2c_init(i2c_dev);
> > > if (ret) {
> > > dev_err(&pdev->dev, "Failed to initialize i2c controller\n");
> >
> >
> > Missing DMA resourcing release on probe failure.
>
> If probe fails due to other reasons, then I2C interface will not be
> available and boot will not even happen.
> Do we need DMA resourcing release?
It's also possible that probe will fail for one of the I2C controllers
that is not critical to basic system functionality. You don't want to
leak these resources because it's bad practice (other people reading the
code may conclude that it's okay to leak resources).
Also, if everyone is really careful about not leaking resources, it
makes it much easier to track down leaks.
Thierry
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists