iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: kernel-janitors@vger.kernel.org, iommu@lists.linux-foundation.org
Subject: Re: [patch] iommu/vt-d: returning free pointer in get_domain_for_dev()
Date: Fri, 28 Mar 2014 20:37:31 +0000	[thread overview]
Message-ID: <1396039051.8569.36.camel@i7.infradead.org> (raw)
In-Reply-To: <20140328082950.GN25192@mwanda>

[-- Attachment #1: Type: text/plain, Size: 845 bytes --]

On Fri, 2014-03-28 at 11:29 +0300, Dan Carpenter wrote:
> If we hit this error condition then we want to return a NULL pointer and
> not a freed variable.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
> index 6fbce01..69fa7da 100644
> --- a/drivers/iommu/intel-iommu.c
> +++ b/drivers/iommu/intel-iommu.c
> @@ -2257,6 +2257,7 @@ static struct dmar_domain *get_domain_for_dev(struct device *dev, int gaw)
>  		goto error;
>  	if (iommu_attach_domain(domain, iommu)) {
>  		free_domain_mem(domain);
> +		domain = NULL;
>  		goto error;
>  	}
>  	free = domain;

Applied; thanks.


-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5745 bytes --]

      reply	other threads:[~2014-03-28 20:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28  8:29 [patch] iommu/vt-d: returning free pointer in get_domain_for_dev() Dan Carpenter
2014-03-28 20:37 ` David Woodhouse [this message]

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=1396039051.8569.36.camel@i7.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=dan.carpenter@oracle.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kernel-janitors@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).