소스 검색

kobject: kobject_put cleanup

This patch removes redundant argument checks for kobject_put().

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Mariusz Kozlowski 18 년 전
부모
커밋
b067db49e1
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      lib/kobject.c

+ 2 - 4
lib/kobject.c

@@ -195,8 +195,7 @@ int kobject_add(struct kobject * kobj)
 	if (error) {
 	if (error) {
 		/* unlink does the kobject_put() for us */
 		/* unlink does the kobject_put() for us */
 		unlink(kobj);
 		unlink(kobj);
-		if (parent)
-			kobject_put(parent);
+		kobject_put(parent);
 
 
 		/* be noisy on error issues */
 		/* be noisy on error issues */
 		if (error == -EEXIST)
 		if (error == -EEXIST)
@@ -420,8 +419,7 @@ void kobject_cleanup(struct kobject * kobj)
 		t->release(kobj);
 		t->release(kobj);
 	if (s)
 	if (s)
 		kset_put(s);
 		kset_put(s);
-	if (parent) 
-		kobject_put(parent);
+	kobject_put(parent);
 }
 }
 
 
 static void kobject_release(struct kref *kref)
 static void kobject_release(struct kref *kref)