Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2400919lqp; Sun, 24 Mar 2024 17:56:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWd32Q/+GFMrXWQJQWc9TORN+x3kaFwxURiNfnO9/fd/uXUY0orvSBxGw4+QDE7YCRYFQu5YV5TsjsDQJ2gxh3EmCl4mzvR5n9921V6+Q== X-Google-Smtp-Source: AGHT+IHdHVOU+EIrNDvThVbLLcsqZRjOkF2mQ+DI658y3LV6YUazlipqw5q6OF8aPxE7FuPni+Mi X-Received: by 2002:a05:6122:4c03:b0:4c0:29e5:d31f with SMTP id ff3-20020a0561224c0300b004c029e5d31fmr3360188vkb.2.1711328207544; Sun, 24 Mar 2024 17:56:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711328207; cv=pass; d=google.com; s=arc-20160816; b=lghgcLvVPPXVTM+sVNfA9PZDSY9MczXeAryTvzPjh2ViT7nekiUNK0CK36tkAusefL WzKEhV0aYfVS+k6UBvgbvcbCnVHEVqxR0EHUpwXATVRyZUIFjMBlb9b7DOucnE8CW6Ii Hf/Ptc1oQeG0XXJ+sRjswVzn4UDQO+Wq7EisA0V1oFMAAD2ITcazNzDejxuc9dPZDlxM tjuRkpNGAzAARhghw0bvbrokry3twuj8REgNEXgq02wGHci721YJDnHId2NScwnWbu7y XCwHxpws0sMc5QfCbzO+9Nsd2vTCAJDP5pAHmLb1kraLKxQWhMEBFqSgR7lhNt/QsIqH 8lfA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Gw4mGjNrJS6Z+h5fvFmQXhn1eatnnx7hSWRwFo4nlg4=; fh=ryk1lBPaAjMWqMh7ldXFQIuAEA4pRyu/ki5XIoCSTKQ=; b=wN4NYP1pdHiNgEPhP361ZK6wNSHbhgf6OBUyvS306TUH0n5zdaHfxME0KklLsJlH4H ygBSFkq4qtKIvvv33ZJCzZxA32WjGhKwzKDopqsVQ801k5GyvgHMuWlV2R9+Z3I/trhU x7XD0s5ro5m+Z1ZLidgCwSGlgUhNt1l4X9fc1yj/ax+FX6H1lMmVEPMrAeFyHOaB575z tkfmtWisv09XjAHwbJpUVlvl7fMUf/dPiWTrVTp/PXzTWJG//FLSAnyY/pr36j6Rr/VZ NlZkJhsIPzq5U6SVZP3ay0cHMijjIo/h6kOgYvw7S+5IkUfDyBcEmUV8QOU+PuAkVknc nj5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fuiG/UXl"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113525-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113525-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id pt19-20020a056214049300b00695d4a4fbfasi6834575qvb.53.2024.03.24.17.56.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:56:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113525-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fuiG/UXl"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113525-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113525-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4780E1C23381 for ; Mon, 25 Mar 2024 00:56:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 068451BE814; Sun, 24 Mar 2024 22:45:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fuiG/UXl" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A3161BE7F4; Sun, 24 Mar 2024 22:45:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320327; cv=none; b=L1pEsh44OxXDt3x2Gwpn1UV8anZPfhA+BnZ6XCUJKUB9XLvWrbm6WDf381X4yYJ4jKMvKnG5xPBsERqxf2tJyG69IIy1kmxPEFmoGYs58y/QmOH1jCX8kt+uznFLf4GWKWdnGYnO58M3S3h3n6RzaXygk5OxtQBnFuP55pLD28k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320327; c=relaxed/simple; bh=h41NIA3cBQEswich+0ng8aJ7IT3gps/J6av94HWph0M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SoW3ilC3Rp2A8/NpPiDi8b9PfZ2X+lpcGeWtfMJg+gq7v38jgBQfUAA+Z6qal5vY5Hem0qWosOfKs3g/fQ8EsYxSJLItVDLaQcQZAhkPOKp99iT3t4m9s8mq7DL0jL5nfZ3XZRbPdjRJNKFdD7gQONQkRQQFnHvX5gW4mH3MdBg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fuiG/UXl; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4247AC43399; Sun, 24 Mar 2024 22:45:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320327; bh=h41NIA3cBQEswich+0ng8aJ7IT3gps/J6av94HWph0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fuiG/UXlPNZrhfctnjQtIKXRtwfwMExvPj/dq+13dffU/jjh//V4jWW6mDW0EsKiB wMJZboMlB/SRFpSBe8S31g4DJ9G8acHbI8bUyYO1jOhSJlhlZ8cN6ZqUKajHZ+sJZO ECHID7m+CnggdIhjgTQQukzW3nWVf0/1ZC86khzAr+je2pZ0AJ3CiuPyYClYt4cQ6h J/ihevDmF06fVam3b9oAQLfc9toTuuIItwrvvJf/DB+4EVrQcJ4lrpy5IOU2GtI0fA TQFpfcwc8/aPo2X0exfoLdnsPlu4dGZ6MGnxlI8SFdFlYCPLqCt0CisC5QxyWhPaP0 6g7pH2ADms7uA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dan Carpenter , Michal Simek , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH 6.8 634/715] char: xilinx_hwicap: Fix NULL vs IS_ERR() bug Date: Sun, 24 Mar 2024 18:33:33 -0400 Message-ID: <20240324223455.1342824-635-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Dan Carpenter [ Upstream commit 316459ba4051fd91237171fdca88920128a646f1 ] The devm_platform_ioremap_resource() function returns error pointers. It never returns NULL. Update the check accordingly. Fixes: 672371832193 ("char: xilinx_hwicap: Modernize driver probe") Signed-off-by: Dan Carpenter Acked-by: Michal Simek Link: https://lore.kernel.org/r/ef647a9c-b1b7-4338-9bc0-28165ec2a367@moroto.mountain Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/char/xilinx_hwicap/xilinx_hwicap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c index 019cf6079cecd..6d2eadefd9dc9 100644 --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c @@ -639,8 +639,8 @@ static int hwicap_setup(struct platform_device *pdev, int id, dev_set_drvdata(dev, (void *)drvdata); drvdata->base_address = devm_platform_ioremap_resource(pdev, 0); - if (!drvdata->base_address) { - retval = -ENODEV; + if (IS_ERR(drvdata->base_address)) { + retval = PTR_ERR(drvdata->base_address); goto failed; } -- 2.43.0