From: Alex Grad <alex.grad@gmail.com>
To: penberg@kernel.org
Cc: sfr@canb.auug.org.au, mikey@neuling.org, daniel.baluta@gmail.com,
linux-kernel@vger.kernel.org, tiejun.chen@windriver.com,
paulus@samba.org, Alex Grad <alex.grad@gmail.com>,
jason.wessel@windriver.com, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH]->[PATCH v2] kgdb: Removed kmalloc returned value cast
Date: Mon, 11 Mar 2013 00:39:48 +0200 [thread overview]
Message-ID: <1362955188-3023-1-git-send-email-alex.grad@gmail.com> (raw)
While at it, check kmalloc return value.
Signed-off-by: Alex Grad <alex.grad@gmail.com>
---
arch/powerpc/kernel/kgdb.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c
index 5ca82cd..9e81dd8 100644
--- a/arch/powerpc/kernel/kgdb.c
+++ b/arch/powerpc/kernel/kgdb.c
@@ -159,7 +159,10 @@ static int kgdb_singlestep(struct pt_regs *regs)
if (user_mode(regs))
return 0;
- backup_current_thread_info = (struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL);
+ backup_current_thread_info = kmalloc(sizeof(struct thread_info), GFP_KERNEL);
+ if (!backup_current_thread_info)
+ return -ENOMEM;
+
/*
* On Book E and perhaps other processors, singlestep is handled on
* the critical exception stack. This causes current_thread_info()
--
1.7.10.4
next reply other threads:[~2013-03-10 22:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-10 22:39 Alex Grad [this message]
2013-03-11 1:33 ` [PATCH]->[PATCH v2] kgdb: Removed kmalloc returned value cast tiejun.chen
2013-03-11 10:14 ` tiejun.chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1362955188-3023-1-git-send-email-alex.grad@gmail.com \
--to=alex.grad@gmail.com \
--cc=daniel.baluta@gmail.com \
--cc=jason.wessel@windriver.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mikey@neuling.org \
--cc=paulus@samba.org \
--cc=penberg@kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=tiejun.chen@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).