All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rolf Eike Beer <eike@sf-mail.de>
To: Prarit Bhargava <prarit@redhat.com>
Cc: Jayamohan.Kallickal@emulex.com, linux-scsi@vger.kernel.org,
	mchristi@redhat.com
Subject: Re: [PATCH]: be2iscsi: Fix MSIX interrupt names
Date: Fri, 20 May 2011 22:17:30 +0200	[thread overview]
Message-ID: <2030549.qtzsKLDxZd@donald.sf-tec.de> (raw)
In-Reply-To: <4DD6B83B.5000703@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1544 bytes --]

Prarit Bhargava wrote:
> On 05/20/2011 02:33 PM, Jayamohan.Kallickal@Emulex.Com wrote:
> > Thanks for the patch. Pl see my comments in line
> 
> np.
> 
> > diff --git a/drivers/scsi/be2iscsi/be_main.c
> > b/drivers/scsi/be2iscsi/be_main.c index 24e20ba..8d71e47 100644
> > --- a/drivers/scsi/be2iscsi/be_main.c
> > +++ b/drivers/scsi/be2iscsi/be_main.c
> > @@ -874,16 +874,20 @@ static int beiscsi_init_irqs(struct beiscsi_hba
> > *phba)
> > 
> >  	struct hwi_controller *phwi_ctrlr;
> >  	struct hwi_context_memory *phwi_context;
> >  	int ret, msix_vec, i, j;
> > 
> > -	char desc[32];
> > 
> >  	phwi_ctrlr = phba->phwi_ctrlr;
> >  	phwi_context = phwi_ctrlr->phwi_ctxt;
> >  	
> >  	if (phba->msix_enabled) {
> >  	
> >  		for (i = 0; i < phba->num_cpus; i++) {
> > 
> > -			sprintf(desc, "beiscsi_msix_%04x", i);
> > +			phba->msi_name[i] = kzalloc(BEISCSI_MSI_NAME,
> > +						    GFP_KERNEL);
> > +			if (!phba->msi_name[i])
> > +				goto free_msix_irqs;
> > We need to ensure i != 0 before jumping to free_msix_irqs
> 
> Will fix in next version ... I think I may have to do a bit more work
> here because I just realized that if we free_irq() on a non-allocated
> irq we'll get an angry message from the kernel ;)  Unfortunately this
> may complicate the code.... I'll rework this and see if I can come up
> with something better.

This could be simpler if you would use devres and devm_kzalloc() and 
devm_request_irq(). You simply need to return with error then and the driver 
core would free everything you already allocated.

Eike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2011-05-20 20:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4DD6AEB7.2090900@redhat.com>
2011-05-20 18:12 ` [PATCH]: be2iscsi: Fix MSIX interrupt names Prarit Bhargava
2011-05-20 18:33   ` Jayamohan.Kallickal
2011-05-20 18:51     ` Prarit Bhargava
2011-05-20 20:17       ` Rolf Eike Beer [this message]
2011-05-24 14:48         ` Prarit Bhargava
2011-05-24 15:09           ` Rolf Eike Beer
2011-06-01 18:55       ` Jayamohan.Kallickal
2011-06-01 19:41         ` Rolf Eike Beer
2011-06-01 23:50           ` Jayamohan.Kallickal
2011-06-02  9:35             ` Rolf Eike Beer
2011-05-20 19:13     ` Prarit Bhargava
2011-05-20 22:07       ` Jayamohan.Kallickal
2011-05-20 23:45         ` Prarit Bhargava
2011-05-23 17:22           ` Jayamohan.Kallickal

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=2030549.qtzsKLDxZd@donald.sf-tec.de \
    --to=eike@sf-mail.de \
    --cc=Jayamohan.Kallickal@emulex.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mchristi@redhat.com \
    --cc=prarit@redhat.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 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.