Skip to content

Commit

Permalink
ata: pata_parport: fix parport release without claim
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ondrej Zary authored and Damien Le Moal committed Mar 15, 2023
1 parent eeac8ed commit dc472c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/ata/pata_parport/pata_parport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit dc472c7

Please sign in to comment.