LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [POWERPC] mpc5200: fix null dereference if bestcomm fails to initialize
@ 2008-03-22  3:41 Grant Likely
  0 siblings, 0 replies; only message in thread
From: Grant Likely @ 2008-03-22  3:41 UTC (permalink / raw)
  To: linux-kernel, paulus, linuxppc-dev

If the bestcomm initialization fails, calls to the task allocate
function should fail gracefully instead of oopsing with a NULL deref.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

Paul, here's another bug fix that I'd like picked up for .25

 arch/powerpc/sysdev/bestcomm/bestcomm.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/sysdev/bestcomm/bestcomm.c b/arch/powerpc/sysdev/bestcomm/bestcomm.c
index f589999..f9cd04e 100644
--- a/arch/powerpc/sysdev/bestcomm/bestcomm.c
+++ b/arch/powerpc/sysdev/bestcomm/bestcomm.c
@@ -52,6 +52,10 @@ bcom_task_alloc(int bd_count, int bd_size, int priv_size)
 	int i, tasknum = -1;
 	struct bcom_task *tsk;
 
+	/* Don't try to do anything is bestcomm init failed */
+	if (!bcom_eng)
+		return NULL;
+
 	/* Get and reserve a task num */
 	spin_lock(&bcom_eng->lock);
 
-- 
1.5.4.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-22  3:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-22  3:41 [PATCH] [POWERPC] mpc5200: fix null dereference if bestcomm fails to initialize Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox