linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pata_parport: fix parport release without claim
@ 2023-03-11 19:25 Ondrej Zary
  2023-03-11 20:27 ` Sergey Shtylyov
  2023-03-15  1:35 ` Damien Le Moal
  0 siblings, 2 replies; 3+ messages in thread
From: Ondrej Zary @ 2023-03-11 19:25 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: Christoph Hellwig, Sergey Shtylyov, linux-ide, linux-kernel

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>
---
 drivers/ata/pata_parport/pata_parport.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/pata_parport/pata_parport.c b/drivers/ata/pata_parport/pata_parport.c
index fb1f10afa722..b31cd2a845db 100644
--- a/drivers/ata/pata_parport/pata_parport.c
+++ b/drivers/ata/pata_parport/pata_parport.c
@@ -558,12 +558,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);
-- 
Ondrej Zary


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pata_parport: fix parport release without claim
  2023-03-11 19:25 [PATCH] pata_parport: fix parport release without claim Ondrej Zary
@ 2023-03-11 20:27 ` Sergey Shtylyov
  2023-03-15  1:35 ` Damien Le Moal
  1 sibling, 0 replies; 3+ messages in thread
From: Sergey Shtylyov @ 2023-03-11 20:27 UTC (permalink / raw)
  To: Ondrej Zary, Damien Le Moal; +Cc: Christoph Hellwig, linux-ide, linux-kernel

On 3/11/23 10:25 PM, Ondrej Zary wrote:

> 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>

MBR, Sergey

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pata_parport: fix parport release without claim
  2023-03-11 19:25 [PATCH] pata_parport: fix parport release without claim Ondrej Zary
  2023-03-11 20:27 ` Sergey Shtylyov
@ 2023-03-15  1:35 ` Damien Le Moal
  1 sibling, 0 replies; 3+ messages in thread
From: Damien Le Moal @ 2023-03-15  1:35 UTC (permalink / raw)
  To: Ondrej Zary; +Cc: Christoph Hellwig, Sergey Shtylyov, linux-ide, linux-kernel

On 3/12/23 04:25, Ondrej Zary wrote:
> 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>

Applied to for-6.3-fixes. Thanks !


-- 
Damien Le Moal
Western Digital Research


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-15  1:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-11 19:25 [PATCH] pata_parport: fix parport release without claim Ondrej Zary
2023-03-11 20:27 ` Sergey Shtylyov
2023-03-15  1:35 ` Damien Le Moal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).