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-next>] [day] [month] [year] [list]
Message-ID: <20061019032801.GB20695@localhost>
Date:	Thu, 19 Oct 2006 12:28:01 +0900
From:	Akinobu Mita <akinobu.mita@...il.com>
To:	Jean Delvare <khali@...ux-fr.org>
Cc:	linux-kernel@...r.kernel.org, Greg Kroah-Hartman <gregkh@...e.de>
Subject: Re: [PATCH] i2c: Fix return value check

On Wed, Oct 18, 2006 at 04:54:50PM +0200, Jean Delvare wrote:

> > Signed-off-by: Akinbou Mita <akinobu.mita@...il.com>
> 
> Typo ;)

Thank you. My template was broken.

> Patch looks correct, however class devices are going away soon, and
> this patch will conflict with Greg's work:
> http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/driver-class/i2c-dev-device.patch
> 
> So your patch should apply on top of Greg's, if still needed after his
> changes. It might even be later folded into Greg's patch to make things
> easier to handle.

I made the patch on top of i2c-dev-device.patch

Subject: i2c: Fix return value check

device_create() returns error code as pointer on failures.
This patch checks the return value of device_create() by using IS_ERR().

Cc: Greg Kroah-Hartman <gregkh@...e.de>
Cc: Jean Delvare <khali@...ux-fr.org>
Signed-off-by: Akinobu Mita <akinobu.mita@...il.com>

 drivers/i2c/i2c-dev.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: work-fault-inject/drivers/i2c/i2c-dev.c
===================================================================
--- work-fault-inject.orig/drivers/i2c/i2c-dev.c
+++ work-fault-inject/drivers/i2c/i2c-dev.c
@@ -417,8 +417,8 @@ static int i2cdev_attach_adapter(struct 
 	i2c_dev->dev = device_create(i2c_dev_class, &adap->dev,
 				     MKDEV(I2C_MAJOR, adap->nr),
 				     "i2c-%d", adap->nr);
-	if (!i2c_dev->dev) {
-		res = -ENODEV;
+	if (IS_ERR(i2c_dev->dev)) {
+		res = PTR_ERR(i2c_dev->dev);
 		goto error;
 	}
 	res = device_create_file(i2c_dev->dev, &dev_attr_name);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ