From: Hannes Reinecke <hare@suse.de>
To: Niklas Cassel <cassel@kernel.org>,
Damien Le Moal <dlemoal@kernel.org>,
John Garry <john.g.garry@oracle.com>,
Jason Yan <yanaijie@huawei.com>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Niklas Cassel <niklas.cassel@wdc.com>,
linux-ide@vger.kernel.org
Subject: Re: [PATCH 2/4] ata,scsi: libata-core: Do not leak memory for ata_port struct members
Date: Mon, 1 Jul 2024 08:21:06 +0200 [thread overview]
Message-ID: <591213f2-792b-4b5e-a344-fa410a1df7e4@suse.de> (raw)
In-Reply-To: <20240629124210.181537-8-cassel@kernel.org>
On 6/29/24 14:42, Niklas Cassel wrote:
> libsas is currently not freeing all the struct ata_port struct members,
> e.g. ncq_sense_buf for a driver supporting Command Duration Limits (CDL).
>
> Add a function, ata_port_free(), that is used to free a ata_port,
> including its struct members. It makes sense to keep the code related to
> freeing a ata_port in its own function, which will also free all the
> struct members of struct ata_port.
>
> Fixes: 18bd7718b5c4 ("scsi: ata: libata: Handle completion of CDL commands using policy 0xD")
> Signed-off-by: Niklas Cassel <cassel@kernel.org>
> ---
> drivers/ata/libata-core.c | 24 ++++++++++++++----------
> drivers/scsi/libsas/sas_ata.c | 2 +-
> drivers/scsi/libsas/sas_discover.c | 2 +-
> include/linux/libata.h | 1 +
> 4 files changed, 17 insertions(+), 12 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
next prev parent reply other threads:[~2024-07-01 6:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-29 12:42 [PATCH 0/4] libata/libsas cleanup fixes Niklas Cassel
2024-06-29 12:42 ` [PATCH 1/4] ata: libata-core: Fix null pointer dereference on error Niklas Cassel
2024-06-30 9:36 ` John Garry
2024-06-29 12:42 ` [PATCH 2/4] ata,scsi: libata-core: Do not leak memory for ata_port struct members Niklas Cassel
2024-06-30 9:42 ` John Garry
2024-06-30 20:28 ` Niklas Cassel
2024-07-01 6:21 ` Hannes Reinecke [this message]
2024-06-29 12:42 ` [PATCH 3/4] ata: libata-core: Fix double free on error Niklas Cassel
2024-06-29 12:42 ` [PATCH 4/4] ata: ahci: Clean up sysfs file " Niklas Cassel
2024-06-30 21:02 ` [PATCH 0/4] libata/libsas cleanup fixes Niklas Cassel
2024-07-03 2:37 ` Martin K. Petersen
2024-06-30 21:05 ` Niklas Cassel
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=591213f2-792b-4b5e-a344-fa410a1df7e4@suse.de \
--to=hare@suse.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=john.g.garry@oracle.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=niklas.cassel@wdc.com \
--cc=yanaijie@huawei.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.