Message ID | 20240629124210.181537-7-cassel@kernel.org |
---|---|
State | New |
Headers | show |
Series | libata/libsas cleanup fixes | expand |
> > Fixes: 633273a3ed1c ("libata-pmp: hook PMP support and enable it") > Cc:stable@vger.kernel.org > Reviewed-by: Damien Le Moal<dlemoal@kernel.org> > Reviewed-by: Hannes Reinecke<hare@suse.de> > Signed-off-by: Niklas Cassel<cassel@kernel.org> > --- Reviewed-by: John Garry <john.g.garry@oracle.com>
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index e1bf8a19b3c8..f47838da75d7 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -5518,6 +5518,9 @@ static void ata_host_release(struct kref *kref) for (i = 0; i < host->n_ports; i++) { struct ata_port *ap = host->ports[i]; + if (!ap) + continue; + kfree(ap->pmp_link); kfree(ap->slave_link); kfree(ap->ncq_sense_buf);