From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65167C352AA for ; Tue, 1 Oct 2019 11:41:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 397382133F for ; Tue, 1 Oct 2019 11:41:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569930087; bh=kHKiQuRfYHGJAypJz7LFWDhrbubzIuK7gPG1SlNxsAw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=fmpWDkaXbc9PmNNNoqTNlqmwTtyq6L6qWajeJNt+FHack0TO739HGYFeqd7TK7XNa 21j0WnOuNu6MibS7BQs8hKMG/AzA94YIyfSk2Q68xrr0Eafs/IZc3JF4rR2sL71R33 jNrhVp5xjUJAvrubtuOUz8tdZM3eIKwKRztHPC34= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732826AbfJALl0 (ORCPT ); Tue, 1 Oct 2019 07:41:26 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:41432 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387681AbfJALlT (ORCPT ); Tue, 1 Oct 2019 07:41:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=y1E3R8dLROwbz+u7OaMfdoIIhxQX9FooeMJGxRhUgSc=; b=xwRDywKyS94HRdedy8s646tUp 27khmRCQ2coohEPGb5rQxVNMszzyodgQm8jAM01Z7xkR1ljJVRJ3hNnHnP/INxE7b3OiGvMpH2ZnK O/oEznclYQx5CkNUgSfBSXElIZxFphEfBZ6eyiLPl9DW/NENZnQfGAw0nHL9XhDuqf+ac=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=ypsilon.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iFGWi-0004Zb-UE; Tue, 01 Oct 2019 11:41:08 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id 62C2E2742A31; Tue, 1 Oct 2019 12:41:08 +0100 (BST) Date: Tue, 1 Oct 2019 12:41:08 +0100 From: Mark Brown To: Geert Uytterhoeven Cc: Lukasz Majewski , Colin Ian King , linux-spi , Krzysztof Kozlowski , Linux Kernel Mailing List , kbuild test robot , Julia Lawall , Dan Carpenter Subject: Re: [PATCH] spi: Avoid calling spi_slave_abort() with kfreed spidev 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" Content-Disposition: inline In-Reply-To: X-Cookie: Keep refrigerated. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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--