public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark yao <mark.yao@rock-chips.com>
To: John Keeping <john@metanate.com>
Cc: Heiko Stuebner <heiko@sntech.de>,
	dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] drm/rockchip: don't leak iommu mapping
Date: Mon, 11 Apr 2016 10:52:49 +0800	[thread overview]
Message-ID: <570B1181.706@rock-chips.com> (raw)
In-Reply-To: <1459864232-25033-2-git-send-email-john@metanate.com>

On 2016年04月05日 21:50, John Keeping wrote:
> arm_iommu_attach_device() takes its own reference to the mapping we give
> it.  Since we do not keep a reference to the mapping ourselves, we must
> release it before returning.
>
> Also fix the error path, which fails to release the mapping if it has
> called arm_iommu_detach_device() since that clears archdata.mapping.
>
> Signed-off-by: John Keeping <john@metanate.com>
> ---
>   drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> index 7695c79..1e2d88b 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
> @@ -218,6 +218,7 @@ static int rockchip_drm_load(struct drm_device *drm_dev, unsigned long flags)
>   	if (ret)
>   		goto err_vblank_cleanup;
>   
> +	arm_iommu_release_mapping(mapping);
>   	return 0;
>   err_vblank_cleanup:
>   	drm_vblank_cleanup(drm_dev);
> @@ -228,7 +229,7 @@ err_unbind:
>   err_detach_device:
>   	arm_iommu_detach_device(dev);
>   err_release_mapping:
> -	arm_iommu_release_mapping(dev->archdata.mapping);
> +	arm_iommu_release_mapping(mapping);
>   err_config_cleanup:
>   	drm_mode_config_cleanup(drm_dev);
>   	drm_dev->dev_private = NULL;
Applied to my drm-fixes

Thanks.

-- 
Mark Yao

  reply	other threads:[~2016-04-11  2:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05 13:50 [PATCH 1/2] drm/rockchip: remove redundant statement John Keeping
2016-04-05 13:50 ` [PATCH 2/2] drm/rockchip: don't leak iommu mapping John Keeping
2016-04-11  2:52   ` Mark yao [this message]
2016-04-11  2:52 ` [PATCH 1/2] drm/rockchip: remove redundant statement Mark yao

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=570B1181.706@rock-chips.com \
    --to=mark.yao@rock-chips.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=john@metanate.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox