lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DB35AME44OW7.8Q673KOM4PD2@kernel.org>
Date: Fri, 04 Jul 2025 10:58:30 +0200
From: "Michael Walle" <mwalle@...nel.org>
To: "Dan Carpenter" <dan.carpenter@...aro.org>,
 <khairul.anuar.romli@...era.com>
Cc: "Mark Brown" <broonie@...nel.org>, "open list:SPI SUBSYSTEM"
 <linux-spi@...r.kernel.org>, "open list" <linux-kernel@...r.kernel.org>,
 "Matthew Gerlach" <matthew.gerlach@...era.com>, "Khairul Anuar Romli"
 <khairulanuar.romli@...era.com>
Subject: Re: [PATCH v3 1/1] spi: spi-cadence-quadspi: Fix pm runtime
 unbalance

Hi,

> > > -	ret = devm_pm_runtime_enable(dev);
> > > -	if (ret) {
> > > -		if (cqspi->rx_chan)
> > > -			dma_release_channel(cqspi->rx_chan);
> > > +	pm_runtime_enable(dev);
> > > +
> > > +	if (cqspi->rx_chan) {
> > > +		dma_release_channel(cqspi->rx_chan);
> > >  		goto probe_setup_failed;
> > >  	}
> > 
> > This will totally break the driver.  It was supposed to be

Yeah. I've just stumbled on that.

> > 
> > 	if (ret) {
> > 		if (cqspi->rx_chan)
> > 			dma_release_channel(cqspi->rx_chan);
> > 		goto probe_setup_failed;
> >   	}
> > 
> > In other words, if we failed there was some slightly complicated
> > cleanup to do.  But now it will do the cleanup and free things on the
> > success path if we're in cqspi->use_direct_mode.
> > 
>
> I suck at email.  What I meant was delete the if block:
>
> -	if (cqspi->rx_chan) {
> -		dma_release_channel(cqspi->rx_chan);
> -		goto probe_setup_failed;
> -	}
> -

Shouldn't the DMA channel be freed if spi_register_controller()
fails?

-michael

Download attachment "signature.asc" of type "application/pgp-signature" (298 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ