All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Tejun Heo <htejun@gmail.com>
Cc: alan@lxorguk.ukuu.org.uk, linux-ide@vger.kernel.org
Subject: Re: [PATCH 01/12] libata: allocate ap separately from shost
Date: Fri, 09 Mar 2007 10:00:16 -0500	[thread overview]
Message-ID: <45F17680.9010006@garzik.org> (raw)
In-Reply-To: <11734389351381-git-send-email-htejun@gmail.com>

Tejun Heo wrote:
> Don't embed ap inside shost.  Allocate it separately and point it back
> from shosts's hostdata.  This makes port allocation more flexible and
> allows regular ATA and SAS share host alloc/init paths.
> 
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
>  drivers/ata/libata-core.c |   15 +++++++++++----
>  include/linux/libata.h    |    2 +-
>  2 files changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 6e124bd..fab488c 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -5646,14 +5646,17 @@ static struct ata_port * ata_port_add(const struct ata_probe_ent *ent,
>  		return NULL;
>  	}
>  
> -	shost = scsi_host_alloc(ent->sht, sizeof(struct ata_port));
> +	ap = kzalloc(sizeof(struct ata_port), GFP_KERNEL);
> +	if (!ap)
> +		return NULL;
> +
> +	shost = scsi_host_alloc(ent->sht, sizeof(struct ata_port *));
>  	if (!shost)
>  		return NULL;

memory leak on error

otherwise OK



  reply	other threads:[~2007-03-09 15:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-09 11:15 [PATCHSET] libata: implement new initialization model, take #3 Tejun Heo
2007-03-09 11:15 ` [PATCH 02/12] libata: separate out ata_host_start() Tejun Heo
2007-03-09 11:15 ` [PATCH 03/12] libata: separate out ata_host_alloc() and ata_host_attach() Tejun Heo
2007-03-09 15:34   ` Jeff Garzik
2007-03-12 22:25   ` Brian King
2007-03-13  6:06     ` Tejun Heo
2007-03-13 22:34       ` Brian King
2007-03-14  4:48         ` Tejun Heo
2007-03-14 15:25           ` Brian King
2007-03-09 11:15 ` [PATCH 04/12] libata: implement ata_host_alloc_pinfo() " Tejun Heo
2007-03-09 16:08   ` Jeff Garzik
2007-03-09 11:15 ` [PATCH 01/12] libata: allocate ap separately from shost Tejun Heo
2007-03-09 15:00   ` Jeff Garzik [this message]
2007-03-09 11:15 ` [PATCH 05/12] libata: convert legacy PCI host handling to new init model Tejun Heo
2007-03-09 17:46   ` Jeff Garzik
2007-03-09 11:15 ` [PATCH 12/12] libata: kill probe_ent and related helpers Tejun Heo
2007-03-09 11:15 ` [PATCH 08/12] libata: convert drivers with combined SATA/PATA ports to new init model Tejun Heo
2007-03-09 12:46   ` Alan Cox
2007-03-09 11:55     ` Jeff Garzik
2007-03-09 13:04       ` Tejun Heo
2007-03-09 11:15 ` [PATCH 09/12] libata: convert ata_pci_init_native_mode() users " Tejun Heo
2007-03-09 11:15 ` [PATCH 10/12] libata: convert the remaining SATA drivers " Tejun Heo
2007-03-09 11:15 ` [PATCH 11/12] libata: convert the remaining PATA " Tejun Heo
2007-03-09 12:49   ` Alan Cox
2007-03-09 11:15 ` [PATCH 07/12] libata: add init helpers including ata_pci_prepare_native_host() Tejun Heo
2007-03-09 11:15 ` [PATCH 06/12] libata: convert native PCI host handling to new init model Tejun Heo
2007-03-09 15:45   ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2007-04-11  6:42 [PATCHSET] libata: implement new initialization model, take #4 Tejun Heo
2007-04-11  6:42 ` [PATCH 01/12] libata: allocate ap separately from shost Tejun Heo
     [not found] <1176821046841-git-send-email-htejun@gmail.com>
2007-04-17 15:04 ` Jeff Garzik

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=45F17680.9010006@garzik.org \
    --to=jeff@garzik.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=htejun@gmail.com \
    --cc=linux-ide@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.