diff options
Diffstat (limited to 'fs/udf/super.c')
| -rw-r--r-- | fs/udf/super.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index 28039923114b..99cb81d0077f 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
| @@ -266,11 +266,8 @@ static int udf_sb_alloc_partition_maps(struct super_block *sb, u32 count) | |||
| 266 | { | 266 | { |
| 267 | struct udf_sb_info *sbi = UDF_SB(sb); | 267 | struct udf_sb_info *sbi = UDF_SB(sb); |
| 268 | 268 | ||
| 269 | sbi->s_partmaps = kcalloc(count, sizeof(struct udf_part_map), | 269 | sbi->s_partmaps = kcalloc(count, sizeof(*sbi->s_partmaps), GFP_KERNEL); |
| 270 | GFP_KERNEL); | ||
| 271 | if (!sbi->s_partmaps) { | 270 | if (!sbi->s_partmaps) { |
| 272 | udf_err(sb, "Unable to allocate space for %d partition maps\n", | ||
| 273 | count); | ||
| 274 | sbi->s_partitions = 0; | 271 | sbi->s_partitions = 0; |
| 275 | return -ENOMEM; | 272 | return -ENOMEM; |
| 276 | } | 273 | } |
| @@ -324,7 +321,8 @@ static void udf_sb_free_partitions(struct super_block *sb) | |||
| 324 | { | 321 | { |
| 325 | struct udf_sb_info *sbi = UDF_SB(sb); | 322 | struct udf_sb_info *sbi = UDF_SB(sb); |
| 326 | int i; | 323 | int i; |
| 327 | if (sbi->s_partmaps == NULL) | 324 | |
| 325 | if (!sbi->s_partmaps) | ||
| 328 | return; | 326 | return; |
| 329 | for (i = 0; i < sbi->s_partitions; i++) | 327 | for (i = 0; i < sbi->s_partitions; i++) |
| 330 | udf_free_partition(&sbi->s_partmaps[i]); | 328 | udf_free_partition(&sbi->s_partmaps[i]); |
| @@ -1071,7 +1069,7 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index) | |||
| 1071 | else | 1069 | else |
| 1072 | bitmap = vzalloc(size); /* TODO: get rid of vzalloc */ | 1070 | bitmap = vzalloc(size); /* TODO: get rid of vzalloc */ |
| 1073 | 1071 | ||
| 1074 | if (bitmap == NULL) | 1072 | if (!bitmap) |
| 1075 | return NULL; | 1073 | return NULL; |
| 1076 | 1074 | ||
| 1077 | bitmap->s_nr_groups = nr_groups; | 1075 | bitmap->s_nr_groups = nr_groups; |
| @@ -2099,7 +2097,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
| 2099 | uopt.fmode = UDF_INVALID_MODE; | 2097 | uopt.fmode = UDF_INVALID_MODE; |
| 2100 | uopt.dmode = UDF_INVALID_MODE; | 2098 | uopt.dmode = UDF_INVALID_MODE; |
| 2101 | 2099 | ||
| 2102 | sbi = kzalloc(sizeof(struct udf_sb_info), GFP_KERNEL); | 2100 | sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); |
| 2103 | if (!sbi) | 2101 | if (!sbi) |
| 2104 | return -ENOMEM; | 2102 | return -ENOMEM; |
| 2105 | 2103 | ||
