From: Tejun Heo <[EMAIL PROTECTED]>

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 <[EMAIL PROTECTED]>
Acked-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 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.3.4

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

Reply via email to