From patchwork Tue May 4 22:18:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 51637 X-Patchwork-Delegate: grant.likely@secretlab.ca Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 7D0E2B7FB7 for ; Wed, 5 May 2010 08:19:13 +1000 (EST) Received: by ozlabs.org (Postfix) id EE9C9B7D11; Wed, 5 May 2010 08:19:06 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by ozlabs.org (Postfix) with ESMTP id 978DBB7BEE for ; Wed, 5 May 2010 08:19:05 +1000 (EST) Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 7DEA11C155C3; Wed, 5 May 2010 00:19:02 +0200 (CEST) X-Auth-Info: klgDfTrtaRLsaDBHmJ+5isjfMzJNHSdDdWQVybqADas= Received: from localhost (pD953C1EA.dip.t-dialin.net [217.83.193.234]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTP id 586749037F; Wed, 5 May 2010 00:19:02 +0200 (CEST) From: Anatolij Gustschin To: linux-kernel@vger.kernel.org Subject: [PATCH] serial: mpc52xx_uart: fix null pointer dereference Date: Wed, 5 May 2010 00:18:59 +0200 Message-Id: <1273011539-13994-1-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: Cc: linuxppc-dev@ozlabs.org, leonardo.lists@gmail.com, gregkh@suse.de, Anatolij Gustschin X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Commit 6acc6833510db8f72b5ef343296d97480555fda9 introduced NULL pointer dereference and kernel crash on ppc32 machines while booting. Fix this bug now. Reported-by: Leonardo Chiquitto Signed-off-by: Anatolij Gustschin Acked-by: Grant Likely --- drivers/serial/mpc52xx_uart.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index a176ab4..02469c3 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c @@ -1467,7 +1467,7 @@ mpc52xx_uart_init(void) /* * Map the PSC FIFO Controller and init if on MPC512x. */ - if (psc_ops->fifoc_init) { + if (psc_ops && psc_ops->fifoc_init) { ret = psc_ops->fifoc_init(); if (ret) return ret;