The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: minskey <chaohong_guo@linux.intel.com>
To: linux-kernel@vger.kernel.org
Cc: dan.j.williams@intel.com
Subject: Re: [PATCH V2 ] ioatdma:  Release memory in error handling path
Date: Mon, 12 Apr 2010 12:00:54 +0800	[thread overview]
Message-ID: <1271044854.4957.20.camel@minskey-desktop> (raw)
In-Reply-To: <1271043661.4957.13.camel@minskey-desktop>


Very sorry, re-send it : correct for compiling error


    Release memory in error handling path

Signed-off-by: Minskey Guo <chaohong_guo@linux.intel.com>

---
 drivers/dma/ioat/pci.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/ioat/pci.c b/drivers/dma/ioat/pci.c
index a6e93ee..2a3dae9 100644
--- a/drivers/dma/ioat/pci.c
+++ b/drivers/dma/ioat/pci.c
@@ -153,10 +153,12 @@ static int __devinit ioat_pci_probe(struct pci_dev
*pdev, const struct pci_devic
        else if (device->version >= IOAT_VER_3_0)
                err = ioat3_dma_probe(device, ioat_dca_enabled);
        else
-               return -ENODEV;
+               err = -ENODEV;

        if (err) {
                dev_err(dev, "Intel(R) I/OAT DMA Engine init failed\n");
+               pci_set_drvdata(pdev, NULL);
+               devm_kfree(dev, device);
                return -ENODEV;
        }
--
1.6.3.3


-minskey


在 2010-04-12一的 11:41 +0800,minskey写道:
> Release memory in error handling path
> 
> Signed-off-by: Minskey Guo <chaohong_guo@linux.intel.com>
> 
> ---
>  drivers/dma/ioat/pci.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/dma/ioat/pci.c b/drivers/dma/ioat/pci.c
> index a6e93ee..2a3dae9 100644
> --- a/drivers/dma/ioat/pci.c
> +++ b/drivers/dma/ioat/pci.c
> @@ -153,10 +153,12 @@ static int __devinit ioat_pci_probe(struct pci_dev
> *pdev, const struct pci_devic
>         else if (device->version >= IOAT_VER_3_0)
>                 err = ioat3_dma_probe(device, ioat_dca_enabled);
>         else
> -               return -ENODEV;
> +               err = -ENODEV;
> 
>         if (err) {
>                 dev_err(dev, "Intel(R) I/OAT DMA Engine init failed\n");
> +               pci_set_drvdata(pdev, NULL);
> +               devm_kfree(dev, device)
>                 return -ENODEV;
>         }
> --
> 1.6.3.3
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



      reply	other threads:[~2010-04-12  4:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-12  3:41 [PATCH] ioatdma: Release memory in error handling path minskey
2010-04-12  4:00 ` minskey [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=1271044854.4957.20.camel@minskey-desktop \
    --to=chaohong_guo@linux.intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-kernel@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