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]
Date:	Tue, 23 Mar 2010 11:01:28 +0100
From:	Jean-Michel Hautbois <jhautbois@...il.com>
To:	"Jean Delvare (PC drivers, core)" <khali@...ux-fr.org>,
	"Ben Dooks (embedded platforms)" <ben-linux@...ff.org>
Cc:	linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
	Jean-Michel Hautbois <jhautbois@...il.com>
Subject: [PATCH]I2C device - release cleanup

Hi there,

Here is a little patch which aims to cleanup the release function in i2c-dev.c.
This is only a call to single_release, instead of kfree and several things.

Signed-off-by: Jean-Michel Hautbois <jhautbois@...il.com>
---
drivers/i2c/i2c-dev.c

--- linux-2.6.34-rc2/drivers/i2c/i2c-dev.c.orig	2010-03-23
10:19:26.000000000 +0100
+++ linux-2.6.34-rc2/drivers/i2c/i2c-dev.c	2010-03-23 10:55:54.000000000 +0100
@@ -36,6 +36,7 @@
 #include <linux/i2c-dev.h>
 #include <linux/jiffies.h>
 #include <asm/uaccess.h>
+#include <linux/seq_file.h>

 static struct i2c_driver i2cdev_driver;

@@ -477,12 +478,10 @@ static int i2cdev_open(struct inode *ino
 static int i2cdev_release(struct inode *inode, struct file *file)
 {
 	struct i2c_client *client = file->private_data;
-
+	
 	i2c_put_adapter(client->adapter);
-	kfree(client);
-	file->private_data = NULL;
-
-	return 0;
+	
+	return single_release(inode, file);
 }

 static const struct file_operations i2cdev_fops = {
--
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