From patchwork Sat Mar 11 19:25:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Zary X-Patchwork-Id: 68185 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp425869wrd; Sat, 11 Mar 2023 11:45:55 -0800 (PST) X-Google-Smtp-Source: AK7set/R5pdGqdTYSza2s4apTdO4oqf6HouwWA+8bpGKhLcWEqUmYznInjGv6WqlDESFNnFRhqbQ X-Received: by 2002:a17:902:cec1:b0:19c:a86d:b34e with SMTP id d1-20020a170902cec100b0019ca86db34emr36713847plg.4.1678563955501; Sat, 11 Mar 2023 11:45:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678563955; cv=none; d=google.com; s=arc-20160816; b=LJq6zOjOHFTL/UPo/y1PCnoNg+fQQJCqJyUsrZOQCuYoDx1g00OJ9wHqL8lz7aPDBG kciae9G0/z76WQCmWtFHj2dmRRra8UBR9Rip54yqYmK+Y2du9JoMnr5a/B5MBAePldqu J9T78CXmiLPtFHFyzlSO5dJssNNWvjTP12STI95fiSPiQL05EE/Wd1+N4Qqroi3V1E4v VtY1KfIHbT9slsgqqrBGHJwwjy90OYo4zEzYOr9DgQcjGqKK2Fa2AQUbPEciWCnVLmq5 hNlRZ/yNBxQfkhjJ3IjWx19/EWHL8oCYwKTiDoxJ4lMwcJiqh75syb955q/q6tEkSqi3 dIaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=x2OV9HeByRKEWcBvjc6Jb5gyWreJCKuunOWj+YPgf4Q=; b=bmcQIfLe+upnP4BdNu/LwQhj6eSkNEIEkrIZIYkYiX7Wa6pUjhabAx9acgdru99RRf s5PBXID+I5ZN9ySmSy/gSiIQI4L2bLYXUidJ8p0gyaHn1xWSZjlZhbGoz18UMNisp5JQ MK82Uxjxyse4eiX45qgNOxNEFLTQwaORSSqkWGUit3zK/stWxDWb3vR4NlhMGRV6NCeq xpfN7ckwrvDjKFKHXKcqHIwhby/nteV1nRjaFK5SS7mCcpJdJRWb2zwSc+NGCp36SHwL wF3PRnFUpjeGBUat9xFiCdn3+A0LdIiV8k6kZs9Lx+d1tvHDtLTJLuyvGXgn44vxIvMh /TSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kq5-20020a170903284500b0019e68e3228bsi2791272plb.166.2023.03.11.11.45.40; Sat, 11 Mar 2023 11:45:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229767AbjCKTZt (ORCPT + 99 others); Sat, 11 Mar 2023 14:25:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjCKTZs (ORCPT ); Sat, 11 Mar 2023 14:25:48 -0500 Received: from hosting.gsystem.sk (hosting.gsystem.sk [212.5.213.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A3D335C9FA; Sat, 11 Mar 2023 11:25:46 -0800 (PST) Received: from gsql.ggedos.sk (off-20.infotel.telecom.sk [212.5.213.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by hosting.gsystem.sk (Postfix) with ESMTPSA id DB4D37A01B9; Sat, 11 Mar 2023 20:25:45 +0100 (CET) From: Ondrej Zary To: Damien Le Moal Cc: Christoph Hellwig , Sergey Shtylyov , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] pata_parport: fix parport release without claim Date: Sat, 11 Mar 2023 20:25:38 +0100 Message-Id: <20230311192538.29067-1-linux@zary.sk> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760101878075146001?= X-GMAIL-MSGID: =?utf-8?q?1760101878075146001?= 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 Reviewed-by: Sergey Shtylyov --- 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);