Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp8152rdb; Mon, 30 Oct 2023 21:01:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IETYrFzDk655ZH1rFzXP2xVKj3rZ4nUrHHlUbT1MBB91fOJ09mcaU0Da/vntSPsJP2a0OIT X-Received: by 2002:a05:6358:7e47:b0:169:8620:a23c with SMTP id p7-20020a0563587e4700b001698620a23cmr1093552rwm.4.1698724882425; Mon, 30 Oct 2023 21:01:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698724882; cv=none; d=google.com; s=arc-20160816; b=nyDkHj309w9Q5YVUplzUp/ScLj7sa2JBdugTlASU3Tj0rWN9noZQeoWKa+OeUOP5hW 6zKI/5/tb3Lx+OoJhGh4iogPlMQX0xeNMld6bWzypZyjmmRT5fgQdKO0IKvqID11CvTv woBWZ8TxbvJlx/fGbFR9XWo0N/jLQc2+HVywTTN00y4is3y1x4CeqMKePNz5XGbC0S9s NFcOOdXszYz7MnoVn3Y9larz7NtR3BXZvon2nGLn+CKmMio0dQ2lJ6imcSw3LNtCQjT2 OVoTR4xMivk0ZHFnNiAp0PrcEha7IhdMJnwmSBUG7MAE44AnZBqbzwVkOhLLBDBb+jGq 3ggA== 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=LZvpG4m4vnx4aNckf4UcC1Mp+79jGYEMY9Udx5Vx50s=; fh=EJAwnu2Mwhux4j0vnePV91g7EiFqWgSAa46fDHZIuBQ=; b=jY0MkJg9DXsjtNzDKBnN1CPUjy94b1bqORpOCyODBqAYW0YNP3r4Q0z/Lv1l8JWwWw C9lFmeybVYTNefIuduY6qydHKFUYtwlXoXfSshNEVxzkflBK5LTGhs0x5lccek/27hgC CXePXr0ZwrrDb89sT2rPPhnMj0xjNtYXccv8Lm1IgQkSkH4wMsUWseocJ+xSmWhJTpVT ZLFRx5/QJKj2DqUq8CxRxh0Vor+oGWR1Exp7QNCF0GPbBgdZ9gFUc12Ze40QvgmTDgTe YaQQ3qek31e5KJzYb7JlkSHWrBx9USUSn+r6aQzc5SI6rrTQfuEuU0PnO8el5S9TmsUD Ugsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id l128-20020a633e86000000b005649f560ebesi438707pga.525.2023.10.30.21.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 21:01:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id C1CF0807596D; Mon, 30 Oct 2023 21:00:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235850AbjJaEAw (ORCPT + 99 others); Tue, 31 Oct 2023 00:00:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjJaEAq (ORCPT ); Tue, 31 Oct 2023 00:00:46 -0400 Received: from cstnet.cn (smtp21.cstnet.cn [159.226.251.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBC56B4 for ; Mon, 30 Oct 2023 21:00:41 -0700 (PDT) Received: from localhost (unknown [124.16.138.129]) by APP-01 (Coremail) with SMTP id qwCowAAHDx8ke0BldmfOAQ--.28967S2; Tue, 31 Oct 2023 11:57:24 +0800 (CST) From: Chen Ni To: s.shtylyov@omp.ru, dlemoal@kernel.org, jeff@garzik.org, htejun@gmail.com Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, Chen Ni Subject: [PATCH] pata_isapnp: Add check for devm_ioport_map Date: Tue, 31 Oct 2023 04:00:07 +0000 Message-Id: <20231031040007.2498659-1-nichen@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: qwCowAAHDx8ke0BldmfOAQ--.28967S2 X-Coremail-Antispam: 1UD129KBjvdXoWrtw4xWw1UKrW5XF1rZF15twb_yoWfJFX_Aa yUZF4fW3yvyry5Gw13XF1fZFySgws5ursxXrZYgF93Jry5Zw47WFWYvwnxZayDZ3WrWFn8 AF1Ut3s8uF15JjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbcxFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr 0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj 6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr 0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxkIecxEwVAFwVW8 GwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r 1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij 64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr 0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF 0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7VUUEfO7UUUUU== X-Originating-IP: [124.16.138.129] X-CM-SenderInfo: xqlfxv3q6l2u1dvotugofq/ X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 30 Oct 2023 21:00:59 -0700 (PDT) Add check for devm_ioport_map() and return the error if it fails in order to guarantee the success of devm_ioport_map(). Fixes: 0d5ff566779f ("libata: convert to iomap") Signed-off-by: Chen Ni --- drivers/ata/pata_isapnp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/ata/pata_isapnp.c b/drivers/ata/pata_isapnp.c index 25a63d043c8e..0f77e0424066 100644 --- a/drivers/ata/pata_isapnp.c +++ b/drivers/ata/pata_isapnp.c @@ -82,6 +82,9 @@ static int isapnp_init_one(struct pnp_dev *idev, const struct pnp_device_id *dev if (pnp_port_valid(idev, 1)) { ctl_addr = devm_ioport_map(&idev->dev, pnp_port_start(idev, 1), 1); + if (!ctl_addr) + return -ENOMEM; + ap->ioaddr.altstatus_addr = ctl_addr; ap->ioaddr.ctl_addr = ctl_addr; ap->ops = &isapnp_port_ops; -- 2.25.1