lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 8 Jan 2016 10:04:41 +0800
From:	kbuild test robot <lkp@...el.com>
To:	Jason Gunthorpe <jgunthorpe@...idianresearch.com>
Cc:	kbuild-all@...org,
	Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
	tpmdd-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
	Peter Huewe <peterhuewe@....de>
Subject: [PATCH] tpm_crb: fix ptr_ret.cocci warnings

drivers/char/tpm/tpm_crb.c:297:1-3: WARNING: PTR_ERR_OR_ZERO can be used


 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

CC: Jason Gunthorpe <jgunthorpe@...idianresearch.com>
Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
---

 tpm_crb.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/drivers/char/tpm/tpm_crb.c
+++ b/drivers/char/tpm/tpm_crb.c
@@ -294,9 +294,7 @@ static int crb_map_io(struct acpi_device
 	memcpy_fromio(&pa, &priv->cca->rsp_pa, 8);
 	pa = le64_to_cpu(pa);
 	priv->rsp = crb_access(dev, priv, pa, ioread32(&priv->cca->rsp_size));
-	if (IS_ERR(priv->rsp))
-		return PTR_ERR(priv->rsp);
-	return 0;
+	return PTR_ERR_OR_ZERO(priv->rsp);
 }
 
 static int crb_acpi_add(struct acpi_device *device)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ