Pekka Enberg
2005-03-28 18:01:24 UTC
This patch removes redundant kfree() NULL checks from fs/isofs/rock.c.
Signed-off-by: Pekka Enberg <***@cs.helsinki.fi>
---
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 ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Signed-off-by: Pekka Enberg <***@cs.helsinki.fi>
---
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 ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------