Skip to content

Commit

Permalink
Merge tag 'for-v3.7-fixes' of git://git.infradead.org/users/cbou/linu…
Browse files Browse the repository at this point in the history
…x-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
  • Loading branch information
Linus Torvalds committed Nov 15, 2012
2 parents e801745 + 70a6f46 commit 006b956
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/pstore/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c)

while (s < e) {
unsigned long flags;
u64 id;

if (c > psinfo->bufsize)
c = psinfo->bufsize;
Expand All @@ -172,7 +173,7 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c)
spin_lock_irqsave(&psinfo->buf_lock, flags);
}
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);
s += c;
c = e - s;
Expand Down

0 comments on commit 006b956

Please sign in to comment.