From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp38.i.mail.ru ([94.100.177.98]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UVli6-0008Rj-Q0 for barebox@lists.infradead.org; Fri, 26 Apr 2013 16:41:26 +0000 From: Alexander Shiyan Date: Fri, 26 Apr 2013 20:41:10 +0400 Message-Id: <1366994474-21325-5-git-send-email-shc_work@mail.ru> In-Reply-To: <1366994474-21325-1-git-send-email-shc_work@mail.ru> References: <1366994474-21325-1-git-send-email-shc_work@mail.ru> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 5/9] MCI: imx-esdhc: Fix possible null pointer dereference To: barebox@lists.infradead.org Signed-off-by: Alexander Shiyan --- drivers/mci/imx-esdhc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c index 8c2695c..8194b4d 100644 --- a/drivers/mci/imx-esdhc.c +++ b/drivers/mci/imx-esdhc.c @@ -450,10 +450,15 @@ static int esdhc_card_present(struct mci_host *mci) static int esdhc_init(struct mci_host *mci, struct device_d *dev) { struct fsl_esdhc_host *host = to_fsl_esdhc(mci); - struct fsl_esdhc __iomem *regs = host->regs; + struct fsl_esdhc __iomem *regs; int timeout = 1000; int ret = 0; + if (!host) + return -EIO; + + regs = host->regs; + /* Enable cache snooping */ if (host && !host->no_snoop) esdhc_write32(®s->scr, 0x00000040); -- 1.8.1.5 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox