From patchwork Mon May 25 09:16:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11568313 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 82C3D739 for ; Mon, 25 May 2020 09:16:41 +0000 (UTC) Received: by mail.kernel.org (Postfix) id 7E1D2208B6; Mon, 25 May 2020 09:16:41 +0000 (UTC) Delivered-To: soc@kernel.org Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 20ECD20787 for ; Mon, 25 May 2020 09:16:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="quNFZC8N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20ECD20787 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linus.walleij@linaro.org Received: by mail-lj1-f194.google.com with SMTP id a25so8326545ljp.3 for ; Mon, 25 May 2020 02:16:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ohEJwhoqSwZ76s6YgACOOHyVU8iazLwMXXUTCVY9Yu8=; b=quNFZC8NDA5oaB6UM9SKg2UILfRuOrVeNF0W5cgFZBSHZCLv3KdoNZHSOjvQW2Ebv8 5QG/RdByzTk0usDPlVN6Em3PvUILKbbJLcIcMfCKKiH0eKL7gky+WSmEo/vYSJnA/1uw MdZv9m+A04sp+hNQNpZskmE/SUXmkVG7mJX7eSi81BU88IrJL41tKVPm4RtDku1c6rXG FWm3kf8SW/64UrSXp79Sc1X557ACrh1WRmVC0HbLCaJQPzy7MGjFDySdtwKaRU7EJSNc goHb3RwF9PI7MtCpo17RBRy1wQ42DiAzpmLboRrE7B8f4+doK7NToHyR8l3s2Pa658yF jxFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ohEJwhoqSwZ76s6YgACOOHyVU8iazLwMXXUTCVY9Yu8=; b=smjrH/qQ0EjU9lY50x8pbMUkzfGtbh4seZlv7597jjuZl8u+S9PSDgnmZGq7p3ktof 4ysb76yS7u3yfolbKxbFMdFXECQwTKuPdjBXNDL2/34nrwrmK7KeDh9EJpVlBTYFjO93 DcT7mJ0zp9ykZcxRInjhXTmddvJasWoM9SASWEJS/GwHX12Wc8ERQ65xYf6lKfFoGjQ3 Y9iFIqx2MY5Dhu7j2mmjJvWQ8h0WLM5lW3anjY4PpDq+8lKpqeSprliYVz06lqMBC1N6 57SKxjeVO3Vu3QCcPcbvUhbZHSRWF7g03BvSTG3CLNckpxzvTLR8Hj3hR7o+kXdDD3y0 iLMw== X-Gm-Message-State: AOAM5336TNBtQF3nUjLclyJo7WCcMRS2Ijc0vV8INT+1DAF+qCppIBbD 9SuCPjsXyWylhCmaO+5l59WtOA== X-Google-Smtp-Source: ABdhPJyKPynsW+auiuviSIK2CbOKzmm5iV5WSMfZPFAjiaxfCjE7pejLzaeunA8woUd0pURHn1KDrg== X-Received: by 2002:a2e:a318:: with SMTP id l24mr12276427lje.45.1590398199304; Mon, 25 May 2020 02:16:39 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id c20sm3998328lfb.33.2020.05.25.02.16.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 02:16:38 -0700 (PDT) From: Linus Walleij List-Id: To: arm@kernel.org, soc@kernel.org Cc: linux-arm-kernel@lists.infradead.org, Wei Yongjun , Hulk Robot , Linus Walleij Subject: [PATCH] bus: arm-integrator-lm: Fix return value check in integrator_ap_lm_probe() Date: Mon, 25 May 2020 11:16:34 +0200 Message-Id: <20200525091634.8274-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 From: Wei Yongjun In case of error, the function of_find_matching_node() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: ccea5e8a5918 ("bus: Add driver for Integrator/AP logic modules") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20200520032150.165388-1-weiyongjun1@huawei.com Signed-off-by: Linus Walleij --- Hi SoC guys, please apply this patch directly for v5.8 wherever the other Versatile stuff was applied, thanks! --- drivers/bus/arm-integrator-lm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/bus/arm-integrator-lm.c b/drivers/bus/arm-integrator-lm.c index 669ea7e1f92e..845b6c43fef8 100644 --- a/drivers/bus/arm-integrator-lm.c +++ b/drivers/bus/arm-integrator-lm.c @@ -78,10 +78,10 @@ static int integrator_ap_lm_probe(struct platform_device *pdev) /* Look up the system controller */ syscon = of_find_matching_node(NULL, integrator_ap_syscon_match); - if (IS_ERR(syscon)) { + if (!syscon) { dev_err(dev, "could not find Integrator/AP system controller\n"); - return PTR_ERR(syscon); + return -ENODEV; } map = syscon_node_to_regmap(syscon); if (IS_ERR(map)) {