Messages in this thread Patch in this message | | | From | Greg Kroah-Hartman <> | Subject | [PATCH 59/75] sysfs: kill unnecessary NULL pointer check in sysfs_release() | Date | Fri, 12 Oct 2007 15:17:03 -0700 |
| |
From: Tejun Heo <htejun@gmail.com>
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@gmail.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- 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 majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |