Skip to content

Commit dc472c7

Browse files
Ondrej ZaryDamien Le Moal
authored andcommitted
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 <[email protected]> Reviewed-by: Sergey Shtylyov <[email protected]> Signed-off-by: Damien Le Moal <[email protected]>
1 parent eeac8ed commit dc472c7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/ata/pata_parport/pata_parport.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,13 @@ static struct pi_adapter *pi_init_one(struct parport *parport,
487487

488488
pi_connect(pi);
489489
if (ata_host_activate(host, 0, NULL, 0, &pata_parport_sht))
490-
goto out_unreg_parport;
490+
goto out_disconnect;
491491

492492
return pi;
493493

494-
out_unreg_parport:
494+
out_disconnect:
495495
pi_disconnect(pi);
496+
out_unreg_parport:
496497
parport_unregister_device(pi->pardev);
497498
if (pi->proto->release_proto)
498499
pi->proto->release_proto(pi);

0 commit comments

Comments
 (0)