Re: [PATCH]: be2iscsi: Fix MSIX interrupt names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Prarit Bhargava wrote:
> On 05/20/2011 02:33 PM, Jayamohan.Kallickal@xxxxxxxxxx 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: signature.asc
Description: This is a digitally signed message part.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux