[PATCH 8/9] isofs: remove redundant kfree checks from rock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch removes redundant kfree() NULL checks from fs/isofs/rock.c.

Signed-off-by: Pekka Enberg <[email protected]>
---

 rock.c |   36 ++++++++++++------------------------
 1 files changed, 12 insertions(+), 24 deletions(-)

Index: 2.6/fs/isofs/rock.c
===================================================================
--- 2.6.orig/fs/isofs/rock.c	2005-03-28 18:24:50.000000000 +0300
+++ 2.6/fs/isofs/rock.c	2005-03-28 18:24:53.000000000 +0300
@@ -130,18 +130,15 @@
 				retnamlen += rr->len - 5;
 				break;
 			case SIG('R', 'E'):
-				if (buffer)
-					kfree(buffer);
+				kfree(buffer);
 				return -1;
 			default:
 				break;
 			}
 		}
 	}
-	if (buffer) {
-		kfree(buffer);
-		buffer = NULL;
-	}
+	kfree(buffer);
+	buffer = NULL;
 	if (cont_extent) {
 		int block, offset, offset1;
 		struct buffer_head * pbh;
@@ -168,12 +165,10 @@
 		} 
 		printk("Unable to read rock-ridge attributes\n");
 	}
-	if (buffer)
-		kfree(buffer);
+	kfree(buffer);
 	return retnamlen;	/* If 0, this file did not have a NM field */
       out:
-	if (buffer)
-		kfree(buffer);
+	kfree(buffer);
 	return 0;
 }
 
@@ -426,10 +421,8 @@
 			}
 		}
 	}
-	if (buffer) {
-		kfree(buffer);
-		buffer = NULL;
-	}
+	kfree(buffer);
+	buffer = NULL;
 	if (cont_extent) {
 		int block, offset, offset1;
 		struct buffer_head * pbh;
@@ -457,8 +450,7 @@
 		printk("Unable to read rock-ridge attributes\n");
 	}
       out:
-	if (buffer)
-		kfree(buffer);
+	kfree(buffer);
 	return 0;
 }
 
@@ -625,10 +617,8 @@
 			break;
 		}
 	}
-	if (buffer) {
-		kfree(buffer);
-		buffer = NULL;
-	}
+	kfree(buffer);
+	buffer = NULL;
 	if (cont_extent) {
 		int block, offset, offset1;
 		struct buffer_head * pbh;
@@ -655,8 +645,7 @@
 		} 
 		printk("Unable to read rock-ridge attributes\n");
 	}
-	if (buffer)
-		kfree(buffer);
+	kfree(buffer);
 
 	if (rpnt == link)
 		goto fail;
@@ -670,8 +659,7 @@
 
 	/* error exit from macro */
       out:
-	if (buffer)
-		kfree(buffer);
+	kfree(buffer);
 	goto fail;
       out_noread:
 	printk("unable to read i-node block");
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux