From: Mark Brown Subject: Re: [PATCH] spi: Avoid calling spi_slave_abort() with kfreed spidev Date: Tue, 1 Oct 2019 12:41:08 +0100 Message-ID: <20191001114108.GA4786@sirena.co.uk> References: <20191001090657.25721-1-lukma@denx.de> <20191001113420.032dbfef@jawa> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LZvS9be/3tNcYl/X" Cc: Lukasz Majewski , Colin Ian King , linux-spi , Krzysztof Kozlowski , Linux Kernel Mailing List , kbuild test robot , Julia Lawall , Dan Carpenter To: Geert Uytterhoeven Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-spi.vger.kernel.org --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Oct 01, 2019 at 12:00:07PM +0200, Geert Uytterhoeven wrote: > On Tue, Oct 1, 2019 at 11:34 AM Lukasz Majewski wrote: > > > On Tue, Oct 1, 2019 at 11:07 AM Lukasz Majewski wrote: > > The if (!dofree) prevents from calling spi_slave_abort() when > > spidev->spi == NULL and spidev is kfree'd. > If spidev->users != 0, the block checking spidev->spi == NULL is never > executed, and spi_slave_abort() will be called. > I'm wondering if spidev->spi can be NULL if spidev->users is still positive. It *shouldn't* be. I think we have other problems if it is. --LZvS9be/3tNcYl/X Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl2TO1MACgkQJNaLcl1U h9Co+gf9EMfuNyB92VOoFo9okqWdMzDPwyTkYJyk6HSgVicME9grYfHDe81a7GjJ 9Dph4fdIVAcDkIFL/MbVPi3hsJCKFy+8QV1htiKYl32T9J3fKWROCKUD67c+PDwb 6LV+0EZCb5He4bdw3/CbrMsLhDTMedQL0/smyCNVcfj9WNeRBX64tv+48sE6lCaZ bIGvhUppBJfIjDUU9hmKBweOp7XdMvGQE8SZmhruhgVEl/XICBkL73hYrHyW0QnJ 6FTJmaYLaW8nTDsk9XEiCM/AV8yC+hGdQhlEg4VxiGJ+1sm3QfXvyqYVQo7umAkV hNXIGjDoZ61XFt7E/0SnzKLru/taCg== =mQ+T -----END PGP SIGNATURE----- --LZvS9be/3tNcYl/X--