From patchwork Tue Feb 20 09:02:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13563678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9B150C48BC4 for ; Tue, 20 Feb 2024 09:02:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=dbDwuqa9J2n9SRXEjEIKgt9G9vKRsDhKCBeeyqg/Am8=; b=ytgCqhtptO8j/e K02TkVbpd1o1mdO+V723yo489yw07VZsom3ibqu9Y7UXLBNmgMAbCcS4DRWl60jYVAvbTfpsfGyui epZY0JEQw9ZYhnGkxLg0e31myh6N/IZC45GfarBUrn6QDIP7DN8Rz0r9pbpzRXKLYabFs0N5prevj jwTe1TkMYuwr4nPiV/r9lQRr1WADU69Og64DCVTsM66BibD97Sa+fzrPIEbHRSNI04zcPw90f1c+x roRry3A4tFADI3FdEYN/TEM1uBQO0/q2DgK3Det5xFaP9yiQLjpzfoL10W7Wn/Yjon3PJZ7BLBG1L hLogpeOWYOpnKVqSpOsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcM1T-0000000Drkm-3H5K; Tue, 20 Feb 2024 09:02:43 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcM1Q-0000000DriO-15AU for linux-arm-kernel@lists.infradead.org; Tue, 20 Feb 2024 09:02:41 +0000 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a3e8be8a7ddso239209366b.2 for ; Tue, 20 Feb 2024 01:02:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708419758; x=1709024558; darn=lists.infradead.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=c2ULPGAo97hdg1ZsQ6jr2biEBRsVNCZw09zaItnJf/I=; b=qlYfv7dE7VXMIrARjNYaM+adjFz/4F3koDVH2Y/lcuhL7i10su7IzX8pPhX1FSuAiY pLo+vqjyP3ZDMXWImhmJQ4OC93KiQw679hBU9nmdxUIFqjoVD3rAIIM1/fz3DATevJaM ZITmKJEAbhRRIxSc5FS67VLaeSnzJ/w/b7fiiO841ImWbXMDO1KcHSYyJzmFOISUytrF vPN/mWUfAK/FmJr0JaqGoGiA2YG6JV6zNXVelN8YGH7wOvX8arljygUWmWtg0t9TlKrz SZZKT4l5E1C60P3tR7ddas4VTcd78Ga9Yx0SmaIsZrB2kRI10bp3oFV9rRlqkJFDPFM7 lUJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708419758; x=1709024558; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=c2ULPGAo97hdg1ZsQ6jr2biEBRsVNCZw09zaItnJf/I=; b=FKQbWJnevJ3Wmbe4DvWIdRoAcI7pVzj6Im8xHpS/1Rl+rJrDTMix9SK/uRXIrTSlWw Km/o5fBfNaLaMfgmcdW0x8ZHiq5mBiXdZhHK2eNUjNdxjFBpRyvRV+V+1I4pGVWMsqeF rbNI26fUrFuR8wzYXOpUp9smxsLtxrNyzpKd1Xk0PRHIBiWNJb6U3GuQv0iPJr3F3wGh sJWL2o+1/QVPTL6UOZQLg/kobePxxcrjN36v4nYvJeENqh6S+5F8Y9RpAukKZHQ995Ua dw7X60Vrewhfg79L8FPdX9vFOXhJFo2ciTeya1BZ51B6lJa3ETCkojhGPYj0gYVt+A9j 8F5Q== X-Forwarded-Encrypted: i=1; AJvYcCUOZbVD47Q4UCm/33o2F+TM6v8C+jrNYSDn0Szkdg2KL/QJ0ZcCoTSq7ZaDQRwZtbwZ9f6I+QJTVoDsix/R3u1Y/af9TcXZrqBstGZOVO/I4W5JTgc= X-Gm-Message-State: AOJu0YyCBtv3jdZ5ayIYI4Zk7XOUjM4q4Tz5dKCHyT47/yXVQkan5Usl DSWrbiQSGYLoCjxCi9WDcAu9Rv6kgOn+yCbOW+1BdREtMW0MnZ0cYnAQxSYpO77HOE066azTnWI B X-Google-Smtp-Source: AGHT+IGgsUZUBFncC+mK5wmv+K0Z3E1af7GlrV1iQKeWxOP7lFLcUK6IrhElSY60RHx27sQUgvqCKA== X-Received: by 2002:a17:906:e2d0:b0:a3f:14f5:2f87 with SMTP id gr16-20020a170906e2d000b00a3f14f52f87mr91187ejb.42.1708419758047; Tue, 20 Feb 2024 01:02:38 -0800 (PST) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id ha1-20020a170906a88100b00a381ca0e589sm3746733ejb.22.2024.02.20.01.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 01:02:37 -0800 (PST) Date: Tue, 20 Feb 2024 12:02:31 +0300 From: Dan Carpenter To: Rob Herring Cc: Arnd Bergmann , Greg Kroah-Hartman , Michal Simek , Uwe =?iso-8859-1?q?Kleine-K=F6nig?= , Benjamin Tissoires , Ivan Orlov , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] char: xilinx_hwicap: Fix NULL vs IS_ERR() bug Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240220_010240_321493_E32DD39A X-CRM114-Status: GOOD ( 13.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 019cf6079cec..6d2eadefd9dc 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; }