File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ static struct pstore_device_info *pstore_device_info;
89
89
_##name_ = check_size(name, alignsize); \
90
90
else \
91
91
_##name_ = 0; \
92
- /* Synchronize module parameters with resuls . */ \
92
+ /* Synchronize module parameters with results . */ \
93
93
name = _ ##name_ / 1024; \
94
94
dev->zone.name = _##name_; \
95
95
}
@@ -121,7 +121,7 @@ static int __register_pstore_device(struct pstore_device_info *dev)
121
121
if (pstore_device_info )
122
122
return - EBUSY ;
123
123
124
- /* zero means not limit on which backends to attempt to store. */
124
+ /* zero means no limit on which backends attempt to store. */
125
125
if (!dev -> flags )
126
126
dev -> flags = UINT_MAX ;
127
127
Original file line number Diff line number Diff line change @@ -1212,6 +1212,11 @@ static struct pstore_zone **psz_init_zones(enum pstore_type_id type,
1212
1212
}
1213
1213
1214
1214
c = total_size / record_size ;
1215
+ if (unlikely (!c )) {
1216
+ pr_err ("zone %s total_size too small\n" , name );
1217
+ return ERR_PTR (- EINVAL );
1218
+ }
1219
+
1215
1220
zones = kcalloc (c , sizeof (* zones ), GFP_KERNEL );
1216
1221
if (!zones ) {
1217
1222
pr_err ("allocate for zones %s failed\n" , name );
You can’t perform that action at this time.
0 commit comments