Unverified Commit af25a5ba authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!8019 pstore/zone: Add a null pointer check to the psz_kmsg_read

parents 03fe15a0 d058315c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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) {