summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorOndrej Zary <linux@zary.sk>2023-03-11 22:25:38 +0300
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>2023-03-15 04:35:00 +0300
commitdc472c7612297ffc9aea655bf6e9538bec5bfedf (patch)
tree618befd68fd8d2851e91b87fcfa2e2075d42cd33 /drivers/ata
parenteeac8ede17557680855031c6f305ece2378af326 (diff)
downloadlinux-dc472c7612297ffc9aea655bf6e9538bec5bfedf.tar.xz
ata: pata_parport: fix parport release without claim
When adapter is not found, pi->disconnect() is called without previous pi->connect(). This results in error like this: parport0: pata_parport tried to release parport when not owner Add missing out_disconnect label and use it correctly. Signed-off-by: Ondrej Zary <linux@zary.sk> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_parport/pata_parport.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/ata/pata_parport/pata_parport.c b/drivers/ata/pata_parport/pata_parport.c
index 294a266a0dda..31c9677a45e3 100644
--- a/drivers/ata/pata_parport/pata_parport.c
+++ b/drivers/ata/pata_parport/pata_parport.c
@@ -487,12 +487,13 @@ static struct pi_adapter *pi_init_one(struct parport *parport,
pi_connect(pi);
if (ata_host_activate(host, 0, NULL, 0, &pata_parport_sht))
- goto out_unreg_parport;
+ goto out_disconnect;
return pi;
-out_unreg_parport:
+out_disconnect:
pi_disconnect(pi);
+out_unreg_parport:
parport_unregister_device(pi->pardev);
if (pi->proto->release_proto)
pi->proto->release_proto(pi);