From: Kashyap Desai <kashyap.desai@avagotech.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Sumit Saxena <sumit.saxena@avagotech.com>
Cc: Uday Lingala <uday.lingala@avagotech.com>,
"James E.J. Bottomley" <JBottomley@odin.com>,
"PDL,MEGARAIDLINUX" <megaraidlinux.pdl@avagotech.com>,
linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: RE: [patch 2/2] megaraid_sas: missing curly braces in megasas_detach_one()
Date: Tue, 10 Nov 2015 15:49:25 +0530 [thread overview]
Message-ID: <5e96883ecfca1464351bf64da1ae723c@mail.gmail.com> (raw)
In-Reply-To: <20151107161709.GB30686@mwanda>
> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> Sent: Saturday, November 07, 2015 9:47 PM
> To: Kashyap Desai; Sumit Saxena
> Cc: Uday Lingala; James E.J. Bottomley; megaraidlinux.pdl@avagotech.com;
> linux-scsi@vger.kernel.org; kernel-janitors@vger.kernel.org
> Subject: [patch 2/2] megaraid_sas: missing curly braces in
> megasas_detach_one()
>
> The indenting indicates that there are supposed to be some curly braces
> here. Presumably it means we free something unintentionally leading to
a
> use after free.
NACK. Indentation is wrong. We don't need to add braces. We will fix
indentation and resend patch. Since this is not critical, let's ignore for
now.
>
> Fixes: 3761cb4cf65e ('megaraid_sas: JBOD sequence number support')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Not tested.
>
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
> b/drivers/scsi/megaraid/megaraid_sas_base.c
> index 829e9e9..91e200d 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -5932,7 +5932,7 @@ static void megasas_detach_one(struct pci_dev
> *pdev)
> fusion->max_map_sz,
> fusion->ld_map[i],
> fusion->ld_map_phys[i]);
> - if (fusion->ld_drv_map[i])
> + if (fusion->ld_drv_map[i]) {
> free_pages((ulong)fusion->ld_drv_map[i],
> fusion->drv_map_pages);
> if (fusion->pd_seq_sync)
> @@ -5940,6 +5940,7 @@ static void megasas_detach_one(struct pci_dev
> *pdev)
> pd_seq_map_sz,
> fusion->pd_seq_sync[i],
> fusion->pd_seq_phys[i]);
> + }
> }
> free_pages((ulong)instance->ctrl_context,
> instance->ctrl_context_pages);
prev parent reply other threads:[~2015-11-10 10:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-07 16:17 [patch 2/2] megaraid_sas: missing curly braces in megasas_detach_one() Dan Carpenter
2015-11-10 10:19 ` Kashyap Desai [this message]
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=5e96883ecfca1464351bf64da1ae723c@mail.gmail.com \
--to=kashyap.desai@avagotech.com \
--cc=JBottomley@odin.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=megaraidlinux.pdl@avagotech.com \
--cc=sumit.saxena@avagotech.com \
--cc=uday.lingala@avagotech.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).