Message ID | ef647a9c-b1b7-4338-9bc0-28165ec2a367@moroto.mountain |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-72638-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp274838dyc; Tue, 20 Feb 2024 01:04:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUAnkIKxAOcL+uI/XpYevHEnD2FbEf8uTwse02SH+Lhk53U4tnK4Zq9EcJSNHHrk3H3KqaKWqGUfLgTQK6fd3BN4zi14g== X-Google-Smtp-Source: AGHT+IF9E2sni6C7vCRiSMczuVvkHlIqLmogRZMcGoVq1eZABQ4G5mW/oH8W586J0adaYtklFPNh X-Received: by 2002:a17:906:7d4:b0:a3e:cc03:d40e with SMTP id m20-20020a17090607d400b00a3ecc03d40emr2374249ejc.63.1708419880220; Tue, 20 Feb 2024 01:04:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708419880; cv=pass; d=google.com; s=arc-20160816; b=EpBX+unJk+5QDZbPAmkfRlmYeXTHAYCqaCfZGONfRhS9cuqF5kl6Vbngtyyh5kR1aL dNEtvynn6HKjEHeULRHlg74iCHrArgzXucTMHxweaIrD6GtyHck9YMxjUPCMg2LsIcj9 R7mF850doqVQy9sffT0saEHAap1OU+S9AV93EVDJHW5MM77ztlGzOsJPi8YT45BdYdnP ZzkYlKlACPQsqgGyCeKVlxeDM61IrrdUL4yG1/Gdfhaj2Y9guEJR+hPu+06mZVC1z1ON aK3PV+Hf+9m3/5alJjIiKWJSbLAMrLV9qcxBn6xjzrnILNC0QsHOJvFZpLAlEUUgMEvd DEsw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=c2ULPGAo97hdg1ZsQ6jr2biEBRsVNCZw09zaItnJf/I=; fh=pSOd+RMErZIlALGMxSv1hpgYSPMUtXaqXVMiQMTYvBw=; b=FiySV70x0UQlsqd1FHPIKMRmKLXlB7xVxnKexnC940dqP9w0R99SUS7oEWy0wG+Fy5 TotI1v4bhz1lt2wCb3bPIXr0padYse1yu+n8WisypyQRsrwslEiumenugURYCkoeBxVD QTIbdoUYD3oM7ohPlP2Tx4aeabStNUvb5947HStVIBnZvVzPrj02wazNTlTcFAEefCHs uQ75JVemub+ZGjXTIInpsk/U4W+tyVhmdXXXZ4Nby2KFermSStRBj/9kedqpyx18ShCg bdsn8z7acX/dVVkvy7FzMSefMQOp6QbGd7eAEl6u3nP4Q4JST4URz5NdMzGOSKQrUPwe VFSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xq1yixNs; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-72638-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72638-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ce3-20020a170906b24300b00a3e4575e5f6si2578260ejb.893.2024.02.20.01.04.40 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 01:04:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72638-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xq1yixNs; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-72638-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72638-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 am.mirrors.kernel.org (Postfix) with ESMTPS id D2A151F2503C for <ouuuleilei@gmail.com>; Tue, 20 Feb 2024 09:04:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE4266215E; Tue, 20 Feb 2024 09:02:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Xq1yixNs" Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A39FF5C8E9 for <linux-kernel@vger.kernel.org>; Tue, 20 Feb 2024 09:02:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708419761; cv=none; b=FmOd7TtIGhg852x52J5fKEXUJ+SgoCi0fsxVCZNMPQuEcXuFRpAnuDp8EC18IuyGRE90JRC+Tp7eV5y7QLHPq5p6mn1bXKNpNZI6E7IBEbGVnyHNglxsR/vJ2ku/0BQj2upMuJaqSBy8tZgtz5V9ruCEbRsPAtMfjLIr7jIQE/I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708419761; c=relaxed/simple; bh=SgoqViaaje+AgC+n7ivCHYAc8WaXGdnEMAxju39c9XY=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=QfQm2lsI08U/vpIUIjSzdJuuYbYRAIoxXhNVbto4XGEWBkbs5B0D7gO2M9Lh2VxK7calgeYOfyBsR93SnKsZpMTtBwD8rDA2O/+N8NKGLQEQxSjUap5cwepgVxu+jonvYh7ljIAPJF1W49KXDjq+fuR2KbaRR+Gg52M5ZFeinGQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Xq1yixNs; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a3e85a76fa8so188537566b.1 for <linux-kernel@vger.kernel.org>; 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=vger.kernel.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=Xq1yixNso7pw/x5t8IT/f4qOdwR+izJKKj3NoXGeM9aPT4+Y3NB/L0BShKiZE1YuBj p7j9E6g6mQj7FcNOV+bbuuaadA+u2XHa7DQ8Ozz6H5YZW5zC21pzl+VLx9U2UWrOAZ9p 9Y1RM7qjagL1Xv9Zu+UhUPN870GVG/00GRrfnfVbMPGfPX/m86fhH15OmFkUdcAjCk0y N+K952V2wtAez61gwBi9T476OzfOBNf+naXLOP+mJDsN7u/8oJOp3cgEmywy8k2QFlGY gbonEHErW1zZIp/4loFJ7CGm8obBIU12h5OHtKeinJDtfHfdbWQ71ocPJrmlHukjutid 0PpQ== 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=oRrUl4OBLn73RaAXimaLQnzK1uUIEenjqjsp8TN4/c2Quq2rnM+6qX25wj9bmMGjIP htfXjv24CJv/ijnZw6CUuNSqHlFKXVoO2Ul39prozi9wSpPz3kOF2dt6uX3/ap6DKh1G qU3u1THAtjxU+ArW1huUc3euzejFbYYgJ4w8yB+dnyZuIfdV3Qk7UEVFiK6OmLKbh9yM R/2OIiLF6DVy/WEMHyGnUCZ+b53dC9pSb+pGVhwP+cW5NYu0m/s/dz7tMuJGXZn4pneL z1ldEoGlJT1yWN64yoN7O3xxQjseYV4bnCCLDhUUjT3505G03x9H+JfonXacAqnBgCcb gbbQ== X-Forwarded-Encrypted: i=1; AJvYcCU0BlKNTmFPRQK3NIqbT8ezGmxXF650/A6A8/l67CJFtTgfCbhr7OuBc1TPTz6WwiFPaxfQQoOPiGhh2RKST2EJlnBvfLShgDt5fGoR X-Gm-Message-State: AOJu0Yy4pHaT+pfSVohOjh55g1U79hQZinJ0yMLzDYqfIWsmf0A8YpeO LVtebRkpcyPqwe+A2RSKGhetywp1KBWWr2lpiGsnbIMkXvu/LLOZtpqd5495Gf4= 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 <dan.carpenter@linaro.org> To: Rob Herring <robh@kernel.org> Cc: Arnd Bergmann <arnd@arndb.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Michal Simek <michal.simek@amd.com>, Uwe =?iso-8859-1?q?Kleine-K=F6nig?= <u.kleine-koenig@pengutronix.de>, Benjamin Tissoires <benjamin.tissoires@redhat.com>, Ivan Orlov <ivan.orlov0322@gmail.com>, 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: <ef647a9c-b1b7-4338-9bc0-28165ec2a367@moroto.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791408084172622546 X-GMAIL-MSGID: 1791408084172622546 |
Series |
char: xilinx_hwicap: Fix NULL vs IS_ERR() bug
|
|
Commit Message
Dan Carpenter
Feb. 20, 2024, 9:02 a.m. UTC
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 <dan.carpenter@linaro.org>
---
drivers/char/xilinx_hwicap/xilinx_hwicap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On 2/20/24 10:02, Dan Carpenter wrote: > 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 <dan.carpenter@linaro.org> > --- > 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; > } > Acked-by: Michal Simek <michal.simek@amd.com> Thanks, Michal
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; }