[patch] inotify: don't check private_data

From: Robert Love
Date: Mon Sep 27 2004 - 16:26:14 EST


On Sun, 2004-09-26 at 22:02 -0400, John McCutchan wrote:

> Announcing the release of inotify 0.10.0.
> Attached is a patch to 2.6.8.1.

Hey, John.

Any reason we check file->private_data in inotify_release()?

I don't think there is. Following patch removes the check.

Robert Love

No need to check file->private_data

Signed-Off-By: Robert Love <rml@xxxxxxxxxx>

drivers/char/inotify.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)

diff -urN linux-inotify/drivers/char/inotify.c linux/drivers/char/inotify.c
--- linux-inotify/drivers/char/inotify.c 2004-09-27 16:28:27.989505320 -0400
+++ linux/drivers/char/inotify.c 2004-09-27 16:34:58.269173792 -0400
@@ -822,15 +822,13 @@

static int inotify_release(struct inode *inode, struct file *file)
{
- if (file->private_data) {
- struct inotify_device *dev;
+ struct inotify_device *dev;

- dev = file->private_data;
- del_timer_sync(&dev->timer);
- inotify_release_all_watchers(dev);
- inotify_release_all_events(dev);
- kfree(dev);
- }
+ dev = file->private_data;
+ del_timer_sync(&dev->timer);
+ inotify_release_all_watchers(dev);
+ inotify_release_all_events(dev);
+ kfree(dev);

printk(KERN_ALERT "inotify device released\n");