lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 12 Apr 2010 12:00:54 +0800
From:	minskey <chaohong_guo@...ux.intel.com>
To:	linux-kernel@...r.kernel.org
Cc:	dan.j.williams@...el.com
Subject: Re: [PATCH V2 ] ioatdma:  Release memory in error handling path


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


    Release memory in error handling path

Signed-off-by: Minskey Guo <chaohong_guo@...ux.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@...ux.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@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ