diff options
Diffstat (limited to 'fs/pstore/zone.c')
| -rw-r--r-- | fs/pstore/zone.c | 3 | 
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/pstore/zone.c b/fs/pstore/zone.c index 2770746bb7aa..694db616663f 100644 --- a/fs/pstore/zone.c +++ b/fs/pstore/zone.c @@ -973,6 +973,8 @@ static ssize_t psz_kmsg_read(struct pstore_zone *zone,  		char *buf = kasprintf(GFP_KERNEL, "%s: Total %d times\n",  				      kmsg_dump_reason_str(record->reason),  				      record->count); +		if (!buf) +			return -ENOMEM;  		hlen = strlen(buf);  		record->buf = krealloc(buf, hlen + size, GFP_KERNEL);  		if (!record->buf) { @@ -1215,7 +1217,6 @@ static struct pstore_zone **psz_init_zones(enum pstore_type_id type,  		pr_err("allocate for zones %s failed\n", name);  		return ERR_PTR(-ENOMEM);  	} -	memset(zones, 0, c * sizeof(*zones));  	for (i = 0; i < c; i++) {  		zone = psz_init_zone(type, off, record_size);  |