All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
To: Johannes Thumshirn <jthumshirn@suse.de>,
	"jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Cc: Dave Carroll <david.carroll@microsemi.com>,
	Gana Sridaran <gana.sridaran@microsemi.com>,
	Scott Benesh <scott.benesh@microsemi.com>,
	"dan.carpenter@oracle.com" <dan.carpenter@oracle.com>
Subject: RE: [PATCH 05/16] aacraid: Fix memory leak in fib init path
Date: Wed, 15 Feb 2017 18:08:53 +0000	[thread overview]
Message-ID: <4D8E82A446BF54499747901DBDEB737A7B8C17D1@avsrvexchmbx2.microsemi.net> (raw)
In-Reply-To: <23eeae24-16d7-1671-2fde-edb17305574a@suse.de>



> -----Original Message-----
> From: Johannes Thumshirn [mailto:jthumshirn@suse.de]
> Sent: Wednesday, February 15, 2017 12:32 AM
> To: Raghava Aditya Renukunta
> <RaghavaAditya.Renukunta@microsemi.com>; jejb@linux.vnet.ibm.com;
> martin.petersen@oracle.com; linux-scsi@vger.kernel.org
> Cc: Dave Carroll <david.carroll@microsemi.com>; Gana Sridaran
> <gana.sridaran@microsemi.com>; Scott Benesh
> <scott.benesh@microsemi.com>; dan.carpenter@oracle.com
> Subject: Re: [PATCH 05/16] aacraid: Fix memory leak in fib init path
> 
> EXTERNAL EMAIL
> 
> 
> On 02/14/2017 09:44 PM, Raghava Aditya Renukunta wrote:
> > aac_fib_map_free frees misaligned fib dma memory, additionally it does
> not
> > free up the whole memory.
> >
> > Fixed by changing the  code to free up the correct and full memory
> > allocation.
> >
> > Cc: stable@vger.kernel.org
> > Fixes: e8b12f0fb835223 ([SCSI] aacraid: Add new code for PMC-Sierra's SRC
> based controller family)
> > Signed-off-by: Raghava Aditya Renukunta
> <RaghavaAditya.Renukunta@microsemi.com>
> > Reviewed-by: David Carroll <David.Carroll@microsemi.com>
> > ---
> >  drivers/scsi/aacraid/commsup.c | 20 +++++++++-----------
> >  1 file changed, 9 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/scsi/aacraid/commsup.c
> b/drivers/scsi/aacraid/commsup.c
> > index f7a3bcb..863c98d 100644
> > --- a/drivers/scsi/aacraid/commsup.c
> > +++ b/drivers/scsi/aacraid/commsup.c
> > @@ -97,8 +97,8 @@ void aac_fib_map_free(struct aac_dev *dev)
> >  {
> >       if (dev->hw_fib_va && dev->max_cmd_size) {
> >               pci_free_consistent(dev->pdev,
> > -             (dev->max_cmd_size *
> > -             (dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB)),
> > +             (dev->max_cmd_size + sizeof(struct aac_fib_xporthdr))
> > +             * (dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB) + 31,
> >               dev->hw_fib_va, dev->hw_fib_pa);
> 
> Can you please do something like:
> 
> size_t alloc_size;
> int numtags;
> 
> numtags = dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB;
> alloc_size = (dev->max_cmd_size + sizeof(struct aac_fib_xporthdr)) *
>                 numtags + 31;
> pci_free_consistent(dev->pdev, alloc_size, dev->hw_fib_va,
>                     dev->hw_fib_pa);
> 
> And please indent correctly. If it indentation doesn't work correctly
> because you hit the 80 chars limit, that's a sign something should be
> reconsidered.

Yes, I will rework this. 

Regards,
Raghava Aditya

> Thanks,
>         Johannes
> --
> Johannes Thumshirn                                          Storage
> jthumshirn@suse.de                                +49 911 74053 689
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)
> Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

  reply	other threads:[~2017-02-15 18:09 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14 20:44 [PATCH 00/16] aacraid: Fixes and enhancements for arc family Raghava Aditya Renukunta
2017-02-14 20:44 ` [PATCH 01/16] aacraid: Fix camel case Raghava Aditya Renukunta
2017-02-15  8:02   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 02/16] aacraid: Use correct channel number for raw srb Raghava Aditya Renukunta
2017-02-15  8:03   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 03/16] aacraid: Fix for excessive prints on EEH Raghava Aditya Renukunta
2017-02-15  8:07   ` Johannes Thumshirn
2017-02-15 18:06     ` Raghava Aditya Renukunta
2017-02-14 20:44 ` [PATCH 04/16] aacraid: Prevent E3 lockup when deleting units Raghava Aditya Renukunta
2017-02-15  8:20   ` Johannes Thumshirn
2017-02-15 18:08     ` Raghava Aditya Renukunta
2017-02-16  7:40       ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 05/16] aacraid: Fix memory leak in fib init path Raghava Aditya Renukunta
2017-02-15  8:31   ` Johannes Thumshirn
2017-02-15 18:08     ` Raghava Aditya Renukunta [this message]
2017-02-14 20:44 ` [PATCH 06/16] aacraid: Added sysfs for driver version Raghava Aditya Renukunta
2017-02-15  8:32   ` Johannes Thumshirn
2017-02-15 18:12     ` Raghava Aditya Renukunta
2017-02-16  7:43       ` Johannes Thumshirn
2017-02-16 19:38         ` Raghava Aditya Renukunta
2017-02-14 20:44 ` [PATCH 07/16] aacraid: Fix sync fibs time out on controller reset Raghava Aditya Renukunta
2017-02-15  8:34   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 08/16] aacraid: Skip wellness sync on controller failure Raghava Aditya Renukunta
2017-02-15  8:35   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 09/16] aacraid: Reload offlined drives after controller reset Raghava Aditya Renukunta
2017-02-15  8:38   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 10/16] aacraid: Terminate kthread on controller fw assert Raghava Aditya Renukunta
2017-02-15  8:44   ` Johannes Thumshirn
2017-02-15 22:22     ` Raghava Aditya Renukunta
2017-02-16  9:31       ` Johannes Thumshirn
2017-02-16 19:53         ` Raghava Aditya Renukunta
2017-02-14 20:44 ` [PATCH 11/16] aacraid: Decrease adapter health check interval Raghava Aditya Renukunta
2017-02-15  8:45   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 12/16] aacraid: Skip IOP reset on controller panic(SMART Family) Raghava Aditya Renukunta
2017-02-15  8:49   ` Johannes Thumshirn
2017-02-15 18:14     ` Raghava Aditya Renukunta
2017-02-14 20:44 ` [PATCH 13/16] aacraid: Reorder Adapter status check Raghava Aditya Renukunta
2017-02-15  8:50   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 14/16] aacraid: Save adapter fib log before an IOP reset Raghava Aditya Renukunta
2017-02-15  8:53   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 15/16] aacraid: Fix a potential spinlock double unlock bug Raghava Aditya Renukunta
2017-02-15  8:54   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 16/16] aacraid: Update driver version Raghava Aditya Renukunta
2017-02-15  8:55   ` Johannes Thumshirn

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=4D8E82A446BF54499747901DBDEB737A7B8C17D1@avsrvexchmbx2.microsemi.net \
    --to=raghavaaditya.renukunta@microsemi.com \
    --cc=dan.carpenter@oracle.com \
    --cc=david.carroll@microsemi.com \
    --cc=gana.sridaran@microsemi.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=scott.benesh@microsemi.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.