Skip to content

Commit cd079b1

Browse files
committed
Merge tag 'libata-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata
Pull libata fixes from Damien Le Moal: "Two fixes for this cycle: - Fix a null pointer dereference in ahci-platform driver (from Hai) - Fix uninitialized variables in pata_legacy driver (from Dan)" * tag 'libata-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: ahci_platform: fix null-ptr-deref in ahci_platform_enable_regulators() pata_legacy: fix a couple uninitialized variable bugs
2 parents f2b3420 + 776c750 commit cd079b1

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

drivers/ata/libahci_platform.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,7 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev,
440440
hpriv->phy_regulator = devm_regulator_get(dev, "phy");
441441
if (IS_ERR(hpriv->phy_regulator)) {
442442
rc = PTR_ERR(hpriv->phy_regulator);
443-
if (rc == -EPROBE_DEFER)
444-
goto err_out;
445-
rc = 0;
446-
hpriv->phy_regulator = NULL;
443+
goto err_out;
447444
}
448445

449446
if (flags & AHCI_PLATFORM_GET_RESETS) {

drivers/ata/pata_legacy.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,8 @@ static unsigned int pdc_data_xfer_vlb(struct ata_queued_cmd *qc,
352352
iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
353353

354354
if (unlikely(slop)) {
355-
__le32 pad;
355+
__le32 pad = 0;
356+
356357
if (rw == READ) {
357358
pad = cpu_to_le32(ioread32(ap->ioaddr.data_addr));
358359
memcpy(buf + buflen - slop, &pad, slop);
@@ -742,7 +743,8 @@ static unsigned int vlb32_data_xfer(struct ata_queued_cmd *qc,
742743
ioread32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
743744

744745
if (unlikely(slop)) {
745-
__le32 pad;
746+
__le32 pad = 0;
747+
746748
if (rw == WRITE) {
747749
memcpy(&pad, buf + buflen - slop, slop);
748750
iowrite32(le32_to_cpu(pad), ap->ioaddr.data_addr);

0 commit comments

Comments
 (0)