linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Peer Chen <pchen@nvidia.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: Re: [PATCH] drivers/ata: correct a wrong free function for sata_nv driver
Date: Wed, 16 May 2007 01:21:27 -0400	[thread overview]
Message-ID: <464A94D7.30300@garzik.org> (raw)
In-Reply-To: <15F501D1A78BD343BE8F4D8DB854566B13CD8F45@hkemmail01.nvidia.com>

Peer Chen wrote:
> For sata_nv driver in kernel 2.6.21 onward, Inside nv_init_one(),use
> 'hpriv = devm_kzalloc(&pdev->dev, sizeof(*hpriv), GFP_KERNEL);' but
> using the kfree(hpriv) to free that data struction in nv_remove_one(),
> which will cause system hang when removing the sata_nv module.
> 
> Change the 'kfree()' function to 'devm_kfree' will fix this bug.
> 
> The patch base on kernel 2.6.22-rc1.
> 
> Signed-off-by: Peer Chen <pchen@nvidia.com>
> =====================================
> --- linux-2.6.22-rc1/drivers/ata/sata_nv.c.orig
> +++ linux-2.6.22-rc1/drivers/ata/sata_nv.c
> @@ -1619,7 +1619,7 @@ static void nv_remove_one (struct pci_de
>  	struct nv_host_priv *hpriv = host->private_data;
>  
>  	ata_pci_remove_one(pdev);
> -	kfree(hpriv);
> +	devm_kfree(&pci_dev->dev, hpriv);

This patch is complete crap.  It doesn't even compile.  There is no 
variable "pci_dev" in this function at all.

It is highly discouraging that you cannot even bother to compile your 
own submissions to the second (or third) most popular operating system 
in the world.

	Jeff



       reply	other threads:[~2007-05-16  5:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <15F501D1A78BD343BE8F4D8DB854566B13CD8F45@hkemmail01.nvidia.com>
2007-05-16  5:21 ` Jeff Garzik [this message]
2007-05-16  5:31   ` [PATCH] drivers/ata: correct a wrong free function for sata_nv driver Peer Chen
2007-05-17 11:13     ` [PATCH] sata_nv: fix fallout of devres conversion Tejun Heo
2007-05-18  0:58       ` Jeff Garzik
     [not found]   ` <15F501D1A78BD343BE8F4D8DB854566B13F197C0@hkemmail01.nvidia.com>
2007-05-18  1:47     ` [PATCH] drivers/ata: Add the SW NCQ support to sata_nv for MCP51/MCP55/MCP61 Robert Hancock

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=464A94D7.30300@garzik.org \
    --to=jeff@garzik.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pchen@nvidia.com \
    /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).