[PATCH 08/15] sysfs: kill unnecessary NULL pointer check in sysfs_release()

From: Tejun Heo
Date: Thu Sep 20 2007 - 03:07:33 EST


In sysfs_release(), sysfs_buffer pointed to by filp->private_data is
guaranteed to exist. Kill the unnecessary NULL check. This also
makes the code more consistent with the counterpart in fs/sysfs/bin.c.

Signed-off-by: Tejun Heo <htejun@xxxxxxxxx>
---
fs/sysfs/file.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 73333dc..8f1ebd8 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -311,11 +311,10 @@ static int sysfs_release(struct inode * inode, struct file * filp)
{
struct sysfs_buffer *buffer = filp->private_data;

- if (buffer) {
- if (buffer->page)
- free_page((unsigned long)buffer->page);
- kfree(buffer);
- }
+ if (buffer->page)
+ free_page((unsigned long)buffer->page);
+ kfree(buffer);
+
return 0;
}

--
1.5.0.3


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/