From 2cd0979707fe1aa840c4cc77df126c88534f7c01 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Sat, 14 Jul 2007 11:03:35 +0900 Subject: [PATCH] --- yaml --- r: 61463 b: refs/heads/master c: 01da2425f327d7ac673e594bee5655523115970b h: refs/heads/master i: 61461: 04268c5d640e28d4ecf53799fcab20441307fa76 61459: 629f9d0e1edf477ac612bdefb9576586525f4b4f 61455: 1a5c716d1cb1d6ee7297473f57c96e4c6f569087 v: v3 --- [refs] | 2 +- trunk/fs/sysfs/dir.c | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index f5a661915e3f..9ad0b26f2c67 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3f8df781fc5f9ee5253a54ba669e1c8872844b86 +refs/heads/master: 01da2425f327d7ac673e594bee5655523115970b diff --git a/trunk/fs/sysfs/dir.c b/trunk/fs/sysfs/dir.c index aee966c44aac..2e6775a836f2 100644 --- a/trunk/fs/sysfs/dir.c +++ b/trunk/fs/sysfs/dir.c @@ -361,20 +361,20 @@ static struct dentry_operations sysfs_dentry_ops = { struct sysfs_dirent *sysfs_new_dirent(const char *name, umode_t mode, int type) { char *dup_name = NULL; - struct sysfs_dirent *sd = NULL; + struct sysfs_dirent *sd; if (type & SYSFS_COPY_NAME) { name = dup_name = kstrdup(name, GFP_KERNEL); if (!name) - goto err_out; + return NULL; } sd = kmem_cache_zalloc(sysfs_dir_cachep, GFP_KERNEL); if (!sd) - goto err_out; + goto err_out1; if (sysfs_alloc_ino(&sd->s_ino)) - goto err_out; + goto err_out2; atomic_set(&sd->s_count, 1); atomic_set(&sd->s_active, 0); @@ -386,9 +386,10 @@ struct sysfs_dirent *sysfs_new_dirent(const char *name, umode_t mode, int type) return sd; - err_out: - kfree(dup_name); + err_out2: kmem_cache_free(sysfs_dir_cachep, sd); + err_out1: + kfree(dup_name); return NULL; }