Linux-SCSI Archive on lore.kernel.org
 help / color / Atom feed
From: Manish Rangankar <mrangankar@marvell.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	"QLogic-Storage-Upstream@qlogic.com" 
	<QLogic-Storage-Upstream@qlogic.com>,
	David Somayajulu <david.somayajulu@qlogic.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: RE: [PATCH] iscsi: qla4xxx: fix double free in probe
Date: Wed, 4 Dec 2019 15:08:04 +0000
Message-ID: <MN2PR18MB3022879D8451A01AC7B0894FD85D0@MN2PR18MB3022.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20191203094421.hw7ex7qr3j2rbsmx@kili.mountain>


> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org <linux-scsi-
> owner@vger.kernel.org> On Behalf Of Dan Carpenter
> Sent: Tuesday, December 3, 2019 3:15 PM
> To: QLogic-Storage-Upstream@qlogic.com; David Somayajulu
> <david.somayajulu@qlogic.com>
> Cc: James E.J. Bottomley <jejb@linux.ibm.com>; Martin K. Petersen
> <martin.petersen@oracle.com>; linux-scsi@vger.kernel.org; kernel-
> janitors@vger.kernel.org
> Subject: [PATCH] iscsi: qla4xxx: fix double free in probe
> 
> On this error path we call qla4xxx_mem_free() and then the caller also calls
> qla4xxx_free_adapter() which calls qla4xxx_mem_free().  It leads to a couple
> double frees:
> 
> drivers/scsi/qla4xxx/ql4_os.c:8856 qla4xxx_probe_adapter() warn: 'ha-
> >chap_dma_pool' double freed
> drivers/scsi/qla4xxx/ql4_os.c:8856 qla4xxx_probe_adapter() warn: 'ha-
> >fw_ddb_dma_pool' double freed
> 
> Fixes: afaf5a2d341d ("[SCSI] Initial Commit of qla4xxx")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/scsi/qla4xxx/ql4_os.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
> index 8c674eca09f1..2323432a0edb 100644
> --- a/drivers/scsi/qla4xxx/ql4_os.c
> +++ b/drivers/scsi/qla4xxx/ql4_os.c
> @@ -4275,7 +4275,6 @@ static int qla4xxx_mem_alloc(struct
> scsi_qla_host *ha)
>  	return QLA_SUCCESS;
> 
>  mem_alloc_error_exit:
> -	qla4xxx_mem_free(ha);
>  	return QLA_ERROR;
>  }
> 
> --
> 2.11.0

Thanks
Acked-by: Manish Rangankar <mrangankar@marvell.com>

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03  9:45 Dan Carpenter
2019-12-04 15:08 ` Manish Rangankar [this message]

Reply instructions:

You may reply publically 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=MN2PR18MB3022879D8451A01AC7B0894FD85D0@MN2PR18MB3022.namprd18.prod.outlook.com \
    --to=mrangankar@marvell.com \
    --cc=QLogic-Storage-Upstream@qlogic.com \
    --cc=dan.carpenter@oracle.com \
    --cc=david.somayajulu@qlogic.com \
    --cc=jejb@linux.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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

Linux-SCSI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-scsi/0 linux-scsi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-scsi linux-scsi/ https://lore.kernel.org/linux-scsi \
		linux-scsi@vger.kernel.org
	public-inbox-index linux-scsi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-scsi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git