All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Will Deacon <will@kernel.org>,
	Lu Baolu <baolu.lu@linux.intel.com>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Sai Prakash Ranjan <quic_saipraka@quicinc.com>,
	Jon Nettleton <jon@solid-run.com>,
	Robin Murphy <robin.murphy@arm.com>,
	linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev,
	kernel@pengutronix.de
Subject: Re: [PATCH 01/10] iommu/arm-smmu: Drop if with an always false condition
Date: Tue, 28 Mar 2023 15:42:21 +0200	[thread overview]
Message-ID: <ZCLuvQv3wzG+SLZh@8bytes.org> (raw)
In-Reply-To: <20230321084125.337021-2-u.kleine-koenig@pengutronix.de>

On Tue, Mar 21, 2023 at 09:41:16AM +0100, Uwe Kleine-König wrote:
> The remove and shutdown callback are only called after probe completed
> successfully. In this case platform_set_drvdata() was called with a
> non-NULL argument and so smmu is never NULL. Other functions in this
> driver also don't check for smmu being non-NULL before using it.
> 
> Also note that returning an error code from a remove callback doesn't
> result in the device staying bound. It's still removed and devm allocated
> resources are freed (among others *smmu and the register mapping). So
> after an early exit to iommu device stayed around and using it probably
> oopses.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/iommu/arm/arm-smmu/arm-smmu.c | 6 ------
>  1 file changed, 6 deletions(-)

Need an ack or review by either Will or Robin on this patch.

Regards,

	Joerg

WARNING: multiple messages have this Message-ID (diff)
From: Joerg Roedel <joro@8bytes.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Will Deacon <will@kernel.org>,
	Lu Baolu <baolu.lu@linux.intel.com>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Sai Prakash Ranjan <quic_saipraka@quicinc.com>,
	Jon Nettleton <jon@solid-run.com>,
	Robin Murphy <robin.murphy@arm.com>,
	linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev,
	kernel@pengutronix.de
Subject: Re: [PATCH 01/10] iommu/arm-smmu: Drop if with an always false condition
Date: Tue, 28 Mar 2023 15:42:21 +0200	[thread overview]
Message-ID: <ZCLuvQv3wzG+SLZh@8bytes.org> (raw)
In-Reply-To: <20230321084125.337021-2-u.kleine-koenig@pengutronix.de>

On Tue, Mar 21, 2023 at 09:41:16AM +0100, Uwe Kleine-König wrote:
> The remove and shutdown callback are only called after probe completed
> successfully. In this case platform_set_drvdata() was called with a
> non-NULL argument and so smmu is never NULL. Other functions in this
> driver also don't check for smmu being non-NULL before using it.
> 
> Also note that returning an error code from a remove callback doesn't
> result in the device staying bound. It's still removed and devm allocated
> resources are freed (among others *smmu and the register mapping). So
> after an early exit to iommu device stayed around and using it probably
> oopses.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/iommu/arm/arm-smmu/arm-smmu.c | 6 ------
>  1 file changed, 6 deletions(-)

Need an ack or review by either Will or Robin on this patch.

Regards,

	Joerg

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-03-28 13:42 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21  8:41 [PATCH 00/10] iommu: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-21  8:41 ` Uwe Kleine-König
2023-03-21  8:41 ` [PATCH 01/10] iommu/arm-smmu: Drop if with an always false condition Uwe Kleine-König
2023-03-21  8:41   ` Uwe Kleine-König
2023-03-28 13:42   ` Joerg Roedel [this message]
2023-03-28 13:42     ` Joerg Roedel
2023-03-28 14:10   ` Robin Murphy
2023-03-28 14:10     ` Robin Murphy
2023-03-21  8:41 ` [PATCH 02/10] iommu/apple-dart: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-21  8:41   ` Uwe Kleine-König
2023-03-21  8:41 ` [PATCH 03/10] iommu/arm-smmu-v3: " Uwe Kleine-König
2023-03-21  8:41   ` Uwe Kleine-König
2023-03-21  8:41 ` [PATCH 04/10] iommu/arm-smmu: " Uwe Kleine-König
2023-03-21  8:41   ` Uwe Kleine-König
2023-03-21  8:41 ` [PATCH 05/10] iommu/ipmmu-vmsa: " Uwe Kleine-König
2023-03-21  8:41 ` [PATCH 06/10] iommu/msm: " Uwe Kleine-König
2023-03-21  8:41 ` [PATCH 07/10] iommu/mtk: " Uwe Kleine-König
2023-03-21  8:41   ` Uwe Kleine-König
2023-03-21  9:45   ` AngeloGioacchino Del Regno
2023-03-21  9:45     ` AngeloGioacchino Del Regno
2023-03-21  8:41 ` [PATCH 08/10] iommu/mtk_iommu_v1: " Uwe Kleine-König
2023-03-21  8:41   ` Uwe Kleine-König
2023-03-21  9:45   ` AngeloGioacchino Del Regno
2023-03-21  9:45     ` AngeloGioacchino Del Regno
2023-03-21  8:41 ` [PATCH 09/10] iommu/omap: " Uwe Kleine-König
2023-03-21  8:41 ` [PATCH 10/10] iommu/sprd: " Uwe Kleine-König
2023-03-31  8:02 ` [PATCH 00/10] iommu: " Joerg Roedel
2023-03-31  8:02   ` Joerg Roedel

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=ZCLuvQv3wzG+SLZh@8bytes.org \
    --to=joro@8bytes.org \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jon@solid-run.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=quic_saipraka@quicinc.com \
    --cc=robin.murphy@arm.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vladimir.oltean@nxp.com \
    --cc=will@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.