summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/sysfs/file.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 73333dc68545..8f1ebd88b9ce 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;
}