Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp117640lqf; Fri, 26 Apr 2024 01:04:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVItpGadfdgbj0ztlMX6oJSckWcCeQE9qj52uSsBqbIRhcQDOe60Tm/K0x/u0JRvAOM1++VGl2JK2gHr4dqxxAvtwUOHKv8K5dw7zU60g== X-Google-Smtp-Source: AGHT+IGu2Abe5ik4TOkeOSeBMkUMKzBUrZWYflyET64xy5ZnjN1DBNAVmh2lZOiUEcalrDLzok1M X-Received: by 2002:a05:6a20:d80a:b0:1ad:22bd:d6d8 with SMTP id iv10-20020a056a20d80a00b001ad22bdd6d8mr2838413pzb.4.1714118689286; Fri, 26 Apr 2024 01:04:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714118689; cv=pass; d=google.com; s=arc-20160816; b=Izr0NPrxNXyacVMmGn3xd7iNhzvEvD4NneKli1zChEbxpC+S8KTiHy/6gcqKZgdtn3 5GnPx+aFM1mkFh+ofr/GA3CeeJfOVya7DEdCCTnET0O/P7QcJxuyIv3kKoA7sWe4r+87 Dg7jjwp0r3lA9EKW4+/63AZ9c9o1M1FIEpZGq24ldHSmw8ql8Lh2Ra3ly9BgsUZ5MPok ENt0lFU4QWg+nM9I66RpIgv8UKQ5vW4NICHyv+DsQbH6LNdHTJTqOzkKGSqlhaSFqhgo BQpY+M5ZKtqjxWON2VucATZvyXVajEw9jgapNlB6aNxn5tpdcsRQ4Hkvn1iqg9qkXSC9 Wq1Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=SQYjjuN20xPmgtev3+UNc6EP/wQPK17xkRrgMTIevXM=; fh=nV+M9qWDXs9M1VtuPeoBg+RmYN2HheRRimjPIrTgsoY=; b=iTI1OT80heMv4AAqlVh+6zNSl+KqQnMUrGT1VqC9etBnG02kw4QDsNWg5enHJNK3Pf k8vnl19vF8QU7De4A5PdCRYoiLTIECPiOPLkRKEU1CHnWdORA/mWVml7Rj23nm4NaWVo d5rXou63gwxqPvbTuOHB5BvQ+vBPUolWYbEEqQIiiYdulUAhepH5A9mdjkbgWFaD8WAd CvU/dyW3uV8sUdwAF170zeO23v5vKa8gCYVvEsdBESn8UtHCSxQGu6w8+Tum9mv14EeE LLN3QO8ZFQg2ixt2sSNRG4S1si8rGosYruLj0TLJsZjCQ+6pOSfjIzvEcdhmB86IsFRa KLZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=iscas.ac.cn); spf=pass (google.com: domain of linux-kernel+bounces-159673-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159673-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d15-20020a65620f000000b005f76fa3ebb9si14463055pgv.396.2024.04.26.01.04.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 01:04:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159673-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=iscas.ac.cn); spf=pass (google.com: domain of linux-kernel+bounces-159673-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159673-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E1789282A78 for ; Fri, 26 Apr 2024 08:04:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2546A13C8F9; Fri, 26 Apr 2024 08:04:44 +0000 (UTC) Received: from cstnet.cn (smtp84.cstnet.cn [159.226.251.84]) (using TLSv1.2 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 218EF13BC28; Fri, 26 Apr 2024 08:04:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.226.251.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714118683; cv=none; b=dnpcoxWhpr019PKfudk355BdWUI4+ujUh+oRMslpxAUu71n3cXMaX+my4GKilXoVePCfBhq8dRzX8rXDpq0Zg/mx6AQu0KK5c1xMafnEycfiLQh1GxQYCVwAW6NrM7LhIrMOimACCi6YRu/vN4+Vfoi2w3WTAuklByWM/9/uIVU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714118683; c=relaxed/simple; bh=QGibK+MjKDWgxbYHPbA4WnjRS7tK0WgFy8+NOQMk5dU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=TJEq+O2MlPvgMDddJzSke/AIaTPHld+UlunT0r6s8L/eqdKvx+c2d/NcXTwBGBqyDuh6oMQmdzh3F24tu2aWQdQmA9hReAP7vs/JWsshux56Yofp3zu3pe6WduAe+JwIUNQrtUrRO93ibkVfKk+FAJ8YBc0X4HqQmuOyWWeuyr8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn; spf=pass smtp.mailfrom=iscas.ac.cn; arc=none smtp.client-ip=159.226.251.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iscas.ac.cn Received: from localhost (unknown [124.16.138.129]) by APP-05 (Coremail) with SMTP id zQCowAA3HROnXitmA8hMBg--.28248S2; Fri, 26 Apr 2024 15:58:32 +0800 (CST) From: Chen Ni To: wim@linux-watchdog.org, linux@roeck-us.net, arnd@arndb.de Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Chen Ni Subject: [PATCH] watchdog: sa1100: Fix PTR_ERR_OR_ZERO() vs NULL check in sa1100dog_probe() Date: Fri, 26 Apr 2024 15:58:08 +0800 Message-Id: <20240426075808.1582678-1-nichen@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:zQCowAA3HROnXitmA8hMBg--.28248S2 X-Coremail-Antispam: 1UD129KBjvdXoWruF43ZFy8ZryxJw13ZrWDJwb_yoWfWFg_Cr W2qF9xWrWDGr1rt3Zrtw43A3yI9FWq9F1xuw4vq39xJ347Gr9xurW7ZrykXayDuay09F98 Jr1DZr4I9r13GjkaLaAFLSUrUUUU8b8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbc8FF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVWxJr 0_GcWln4kS14v26r1Y6r17M2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE 6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72 CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7 MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr 0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0E wIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJV W8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAI cVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjfUnCJmUUUUU X-CM-SenderInfo: xqlfxv3q6l2u1dvotugofq/ devm_ioremap() doesn't return error pointers, it returns NULL on error. Update the check accordingly. Fixes: e86bd43bcfc5 ("watchdog: sa1100: use platform device registration") Signed-off-by: Chen Ni --- drivers/watchdog/sa1100_wdt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c index 5d2df008b92a..34a917221e31 100644 --- a/drivers/watchdog/sa1100_wdt.c +++ b/drivers/watchdog/sa1100_wdt.c @@ -191,9 +191,8 @@ static int sa1100dog_probe(struct platform_device *pdev) if (!res) return -ENXIO; reg_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); - ret = PTR_ERR_OR_ZERO(reg_base); - if (ret) - return ret; + if (!reg_base) + return -ENOMEM; clk = clk_get(NULL, "OSTIMER0"); if (IS_ERR(clk)) { -- 2.25.1