提交 006b9568 编写于 作者: L Linus Torvalds

Merge tag 'for-v3.7-fixes' of git://git.infradead.org/users/cbou/linux-pstore

Pull pstore fix from Anton Vorontsov:
 "A small fixup for the persistent storage subsystem.  The bug can
  prevent kernel booting on a APEI-enabled machines w/ PSTORE_CONSOLE=y
  (this is N by default, though)."

* tag 'for-v3.7-fixes' of git://git.infradead.org/users/cbou/linux-pstore:
  pstore: Fix NULL pointer dereference in console writes
...@@ -161,6 +161,7 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c) ...@@ -161,6 +161,7 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c)
while (s < e) { while (s < e) {
unsigned long flags; unsigned long flags;
u64 id;
if (c > psinfo->bufsize) if (c > psinfo->bufsize)
c = psinfo->bufsize; c = psinfo->bufsize;
...@@ -172,7 +173,7 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c) ...@@ -172,7 +173,7 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c)
spin_lock_irqsave(&psinfo->buf_lock, flags); spin_lock_irqsave(&psinfo->buf_lock, flags);
} }
memcpy(psinfo->buf, s, c); memcpy(psinfo->buf, s, c);
psinfo->write(PSTORE_TYPE_CONSOLE, 0, NULL, 0, c, psinfo); psinfo->write(PSTORE_TYPE_CONSOLE, 0, &id, 0, c, psinfo);
spin_unlock_irqrestore(&psinfo->buf_lock, flags); spin_unlock_irqrestore(&psinfo->buf_lock, flags);
s += c; s += c;
c = e - s; c = e - s;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册