This patch is generated from a coccinelle semantic patch:
identifier t;
expression e;
statement s;
@@
-t = malloc(e);
+t = calloc(1, e);
(
if (!t) s
|
if (t == NULL) s
|
)
-memset(t, 0, e);
Signed-off-by: Silvio Fricke <silvio.fricke@xxxxxxxxx>
---
extent_io.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/extent_io.c b/extent_io.c
index 07695ef..75496ce 100644
--- a/extent_io.c
+++ b/extent_io.c
@@ -538,12 +538,11 @@ static struct extent_buffer *__alloc_extent_buffer(struct extent_io_tree *tree,
{
struct extent_buffer *eb;
- eb = malloc(sizeof(struct extent_buffer) + blocksize);
+ eb = calloc(1, sizeof(struct extent_buffer) + blocksize);
if (!eb) {
BUG();
return NULL;
}
- memset(eb, 0, sizeof(struct extent_buffer) + blocksize);
eb->start = bytenr;
eb->len = blocksize;
--
2.5.3
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html