From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95E41C43381 for ; Tue, 19 Mar 2019 14:44:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C52620850 for ; Tue, 19 Mar 2019 14:44:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553006681; bh=mJLG6wdj5msGKolZKkP2cEsJvYzi5pLFZu0wzi5hQCY=; h=Subject:To:From:Date:List-ID:From; b=HkW0maw5DDXL3cHOLJHDe+Bg0UeeVkXYipY4Y7qfndlcBhu0eXduuhCgQbNSeFYkt PouK+PtR+gddubzMhMmh03esiig47sc6802P0jMT3U8WqEm6tAguhRKQgJtj4wJYAN IT9bjirPKoL9YKfjTCDItc4WTFw7K1gh+QPBWNOo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727329AbfCSOol (ORCPT ); Tue, 19 Mar 2019 10:44:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:56122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727145AbfCSOok (ORCPT ); Tue, 19 Mar 2019 10:44:40 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D77C020850; Tue, 19 Mar 2019 14:44:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553006680; bh=mJLG6wdj5msGKolZKkP2cEsJvYzi5pLFZu0wzi5hQCY=; h=Subject:To:From:Date:From; b=gVf9khhS1nz0g1JpB2/7lLBwsCp4kQspJnjb6C7nZJvKpvHNpCLpxxzQM+kyyUeV+ KYQ5daTp4wzgqHzfF6Ha1au2DzAXkndbFHAQb1li21jw2Mh8NaOGMo5dhGmftzhe65 qoCKeJ/1qUducnsPIBtiBtcCogD/uoTV9nsrqsAo= Subject: patch "tty: mxs-auart: fix a potential NULL pointer dereference" added to tty-linus To: kjlu@umn.edu, gregkh@linuxfoundation.org, stable@vger.kernel.org From: Date: Tue, 19 Mar 2019 15:44:26 +0100 Message-ID: <155300666612712@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled tty: mxs-auart: fix a potential NULL pointer dereference to my tty git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git in the tty-linus branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will hopefully also be merged in Linus's tree for the next -rc kernel release. If you have any questions about this process, please let me know. >From 6734330654dac550f12e932996b868c6d0dcb421 Mon Sep 17 00:00:00 2001 From: Kangjie Lu Date: Thu, 14 Mar 2019 02:21:51 -0500 Subject: tty: mxs-auart: fix a potential NULL pointer dereference In case ioremap fails, the fix returns -ENOMEM to avoid NULL pointer dereferences. Multiple places use port.membase. Signed-off-by: Kangjie Lu Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mxs-auart.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index 27235a526cce..4c188f4079b3 100644 --- a/drivers/tty/serial/mxs-auart.c +++ b/drivers/tty/serial/mxs-auart.c @@ -1686,6 +1686,10 @@ static int mxs_auart_probe(struct platform_device *pdev) s->port.mapbase = r->start; s->port.membase = ioremap(r->start, resource_size(r)); + if (!s->port.membase) { + ret = -ENOMEM; + goto out_disable_clks; + } s->port.ops = &mxs_auart_ops; s->port.iotype = UPIO_MEM; s->port.fifosize = MXS_AUART_FIFO_SIZE; -- 2.21.0