public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Greg KH <gregkh@suse.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-pci@atrey.karlin.mff.cuni.cz,
	Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH 3/3] pci: gt96100eth use pci probing
Date: Thu, 25 May 2006 06:27:15 -0400	[thread overview]
Message-ID: <44758683.4070205@garzik.org> (raw)
In-Reply-To: <44758308.2040408@gmail.com>

Jiri Slaby wrote:
>>> +unprobe:
>>> +    for (j = i; j > 0; j--) {
>>> +        struct gt96100_if_t *gtif = &gtifs[j - 1];
>>> +        gt96100_remove1(gtif);
>>> +    }
>>> +    kfree(gtifs);
>> upon failure, you fail to set drvdata back to NULL
> What is the purpose of setting this to NULL, other drivers don't do that too?

A simple grep(1) shows well over 300 cases that do this.

And it's just logical:  don't leave a pointer hanging around, after it 
has been kfree'd.


>>> +        struct gt96100_private *gp = netdev_priv(gtif->dev);
>>> +        unregister_netdev(gtif->dev);
>>> +        dmafree(RX_HASH_TABLE_SIZE, gp->hash_table_dma);
>>> +        dmafree(PKT_BUF_SZ*RX_RING_SIZE, gp->rx_buff);
>>> +        dmafree(sizeof(gt96100_rd_t) * RX_RING_SIZE
>>> +            + sizeof(gt96100_td_t) * TX_RING_SIZE,
>>> +            gp->rx_ring);
>>> +        free_netdev(gtif->dev);
>>> +        release_region(gtif->iobase, gp->io_size);
>> shouldn't this be using pci_request_regions() / pci_release_regions() ?
> There are GT96100_ETH{0,1}_BASEs instead of bars, 

Indeed.  I stand corrected.

	Jeff



  parent reply	other threads:[~2006-05-25 10:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060525003151.598EAC7C19@atrey.karlin.mff.cuni.cz>
2006-05-25  0:52 ` [PATCH 3/3] pci: gt96100eth use pci probing Jeff Garzik
2006-05-25 10:13   ` Jiri Slaby
2006-05-25 10:17     ` Jiri Slaby
2006-05-25 10:20       ` Jeff Garzik
2006-05-25 10:35         ` Jiri Slaby
2006-05-25 10:27     ` Jeff Garzik [this message]
2006-05-25 10:32       ` Jiri Slaby
2006-05-25 10:35         ` Jeff Garzik
2006-05-25 10:31     ` Jiri Slaby
2006-05-25 10:41   ` Ralf Baechle
2006-05-25 20:36     ` Jiri Slaby

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=44758683.4070205@garzik.org \
    --to=jeff@garzik.org \
    --cc=gregkh@suse.de \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    --cc=ralf@linux-mips.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