diff options
Diffstat (limited to 'drivers/mtd/ftl.c')
-rw-r--r-- | drivers/mtd/ftl.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c index 8a878b34eca0..24235d4f1d23 100644 --- a/drivers/mtd/ftl.c +++ b/drivers/mtd/ftl.c | |||
@@ -1033,7 +1033,7 @@ static void ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) | |||
1033 | { | 1033 | { |
1034 | partition_t *partition; | 1034 | partition_t *partition; |
1035 | 1035 | ||
1036 | partition = kmalloc(sizeof(partition_t), GFP_KERNEL); | 1036 | partition = kzalloc(sizeof(partition_t), GFP_KERNEL); |
1037 | 1037 | ||
1038 | if (!partition) { | 1038 | if (!partition) { |
1039 | printk(KERN_WARNING "No memory to scan for FTL on %s\n", | 1039 | printk(KERN_WARNING "No memory to scan for FTL on %s\n", |
@@ -1041,8 +1041,6 @@ static void ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) | |||
1041 | return; | 1041 | return; |
1042 | } | 1042 | } |
1043 | 1043 | ||
1044 | memset(partition, 0, sizeof(partition_t)); | ||
1045 | |||
1046 | partition->mbd.mtd = mtd; | 1044 | partition->mbd.mtd = mtd; |
1047 | 1045 | ||
1048 | if ((scan_header(partition) == 0) && | 1046 | if ((scan_header(partition) == 0) && |
@@ -1054,7 +1052,7 @@ static void ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) | |||
1054 | le32_to_cpu(partition->header.FormattedSize) >> 10); | 1052 | le32_to_cpu(partition->header.FormattedSize) >> 10); |
1055 | #endif | 1053 | #endif |
1056 | partition->mbd.size = le32_to_cpu(partition->header.FormattedSize) >> 9; | 1054 | partition->mbd.size = le32_to_cpu(partition->header.FormattedSize) >> 9; |
1057 | partition->mbd.blksize = SECTOR_SIZE; | 1055 | |
1058 | partition->mbd.tr = tr; | 1056 | partition->mbd.tr = tr; |
1059 | partition->mbd.devnum = -1; | 1057 | partition->mbd.devnum = -1; |
1060 | if (!add_mtd_blktrans_dev((void *)partition)) | 1058 | if (!add_mtd_blktrans_dev((void *)partition)) |
@@ -1076,6 +1074,7 @@ struct mtd_blktrans_ops ftl_tr = { | |||
1076 | .name = "ftl", | 1074 | .name = "ftl", |
1077 | .major = FTL_MAJOR, | 1075 | .major = FTL_MAJOR, |
1078 | .part_bits = PART_BITS, | 1076 | .part_bits = PART_BITS, |
1077 | .blksize = SECTOR_SIZE, | ||
1079 | .readsect = ftl_readsect, | 1078 | .readsect = ftl_readsect, |
1080 | .writesect = ftl_writesect, | 1079 | .writesect = ftl_writesect, |
1081 | .getgeo = ftl_getgeo, | 1080 | .getgeo = ftl_getgeo, |