@@ -4136,8 +4136,8 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
41364136 { "PIONEER BD-RW BDR-207M" , NULL , ATA_HORKAGE_NOLPM },
41374137 { "PIONEER BD-RW BDR-205" , NULL , ATA_HORKAGE_NOLPM },
41384138
4139- /* Crucial BX100 SSD 500GB has broken LPM support */
4140- { "CT500BX100SSD1 " , NULL , ATA_HORKAGE_NOLPM },
4139+ /* Crucial devices with broken LPM support */
4140+ { "CT*0BX*00SSD1 " , NULL , ATA_HORKAGE_NOLPM },
41414141
41424142 /* 512GB MX100 with MU01 firmware has both queued TRIM and LPM issues */
41434143 { "Crucial_CT512MX100*" , "MU01" , ATA_HORKAGE_NO_NCQ_TRIM |
@@ -4155,6 +4155,12 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
41554155 ATA_HORKAGE_ZERO_AFTER_TRIM |
41564156 ATA_HORKAGE_NOLPM },
41574157
4158+ /* AMD Radeon devices with broken LPM support */
4159+ { "R3SL240G" , NULL , ATA_HORKAGE_NOLPM },
4160+
4161+ /* Apacer models with LPM issues */
4162+ { "Apacer AS340*" , NULL , ATA_HORKAGE_NOLPM },
4163+
41584164 /* These specific Samsung models/firmware-revs do not handle LPM well */
41594165 { "SAMSUNG MZMPC128HBFU-000MV" , "CXM14M1Q" , ATA_HORKAGE_NOLPM },
41604166 { "SAMSUNG SSD PM830 mSATA *" , "CXM13D1Q" , ATA_HORKAGE_NOLPM },
@@ -5491,6 +5497,18 @@ struct ata_port *ata_port_alloc(struct ata_host *host)
54915497 return ap ;
54925498}
54935499
5500+ void ata_port_free (struct ata_port * ap )
5501+ {
5502+ if (!ap )
5503+ return ;
5504+
5505+ kfree (ap -> pmp_link );
5506+ kfree (ap -> slave_link );
5507+ kfree (ap -> ncq_sense_buf );
5508+ kfree (ap );
5509+ }
5510+ EXPORT_SYMBOL_GPL (ata_port_free );
5511+
54945512static void ata_devres_release (struct device * gendev , void * res )
54955513{
54965514 struct ata_host * host = dev_get_drvdata (gendev );
@@ -5517,12 +5535,7 @@ static void ata_host_release(struct kref *kref)
55175535 int i ;
55185536
55195537 for (i = 0 ; i < host -> n_ports ; i ++ ) {
5520- struct ata_port * ap = host -> ports [i ];
5521-
5522- kfree (ap -> pmp_link );
5523- kfree (ap -> slave_link );
5524- kfree (ap -> ncq_sense_buf );
5525- kfree (ap );
5538+ ata_port_free (host -> ports [i ]);
55265539 host -> ports [i ] = NULL ;
55275540 }
55285541 kfree (host );
@@ -5572,8 +5585,10 @@ struct ata_host *ata_host_alloc(struct device *dev, int max_ports)
55725585 if (!host )
55735586 return NULL ;
55745587
5575- if (!devres_open_group (dev , NULL , GFP_KERNEL ))
5576- goto err_free ;
5588+ if (!devres_open_group (dev , NULL , GFP_KERNEL )) {
5589+ kfree (host );
5590+ return NULL ;
5591+ }
55775592
55785593 dr = devres_alloc (ata_devres_release , 0 , GFP_KERNEL );
55795594 if (!dr )
@@ -5605,8 +5620,6 @@ struct ata_host *ata_host_alloc(struct device *dev, int max_ports)
56055620
56065621 err_out :
56075622 devres_release_group (dev , NULL );
5608- err_free :
5609- kfree (host );
56105623 return NULL ;
56115624}
56125625EXPORT_SYMBOL_GPL (ata_host_alloc );
@@ -5905,7 +5918,7 @@ int ata_host_register(struct ata_host *host, const struct scsi_host_template *sh
59055918 * allocation time.
59065919 */
59075920 for (i = host -> n_ports ; host -> ports [i ]; i ++ )
5908- kfree (host -> ports [i ]);
5921+ ata_port_free (host -> ports [i ]);
59095922
59105923 /* give ports names and add SCSI hosts */
59115924 for (i = 0 ; i < host -> n_ports ; i ++ ) {
0 commit comments