aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-09-20 03:05:10 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 17:51:10 -0400
commit50ab1a72863b1ad4b117862bc52610f8d4535609 (patch)
tree41a30dce0ef44917f16d2bc5cdf23cc26f4fac3a
parentb05f0548dabd20433f8c201a0307103721d6a18b (diff)
sysfs: kill unnecessary NULL pointer check in sysfs_release()
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>
-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)
311{ 311{
312 struct sysfs_buffer *buffer = filp->private_data; 312 struct sysfs_buffer *buffer = filp->private_data;
313 313
314 if (buffer) { 314 if (buffer->page)
315 if (buffer->page) 315 free_page((unsigned long)buffer->page);
316 free_page((unsigned long)buffer->page); 316 kfree(buffer);
317 kfree(buffer); 317
318 }
319 return 0; 318 return 0;
320} 319}
321 320