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 A1AA5C43381 for ; Tue, 19 Mar 2019 14:44:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65E2320850 for ; Tue, 19 Mar 2019 14:44:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553006669; bh=FTnaiKQPLnXHnRg6NudgQw2yR/+BwvuKg6g0Jm1F3aA=; h=Subject:To:From:Date:List-ID:From; b=D1vMdrcRoAy+Kih9Hza3c0Si1kpABjSCB8IHpIBRFXkbCs+LnVadUCvznCIe14+dq fPw3wDRBMBPBjaIV3a4o5RjplqDjgR/9y5jViB7LsCKHaoRgUEtizkXkhc0i4Cls35 eSbQpPGkk/t0c/3BRb6mfHbC8fPFXMRvQYzkttKo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727196AbfCSOo3 (ORCPT ); Tue, 19 Mar 2019 10:44:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:55818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727018AbfCSOo2 (ORCPT ); Tue, 19 Mar 2019 10:44:28 -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 AEE3520850; Tue, 19 Mar 2019 14:44:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553006668; bh=FTnaiKQPLnXHnRg6NudgQw2yR/+BwvuKg6g0Jm1F3aA=; h=Subject:To:From:Date:From; b=vR0/cZuM/faGzsjik42oaZnSXgK2nHeNsWSPzRjqUwPlI/RccHC5kZbh5uU0F+78/ UT8QQJTbSLjT/nPbPzZcLo5A47YvKY/eoO6kLVCr8f44e053VBDl/VNOL4otpRJil+ 7HljEBRu3g2SP7dqB6h1qr3nzzkeNIwuGI6NJaKI= Subject: patch "serial: mvebu-uart: Fix to avoid a potential NULL pointer dereference" added to tty-linus To: pakki001@umn.edu, gregkh@linuxfoundation.org, stable@vger.kernel.org From: Date: Tue, 19 Mar 2019 15:44:25 +0100 Message-ID: <155300666511243@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 serial: mvebu-uart: Fix to avoid 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 32f47179833b63de72427131169809065db6745e Mon Sep 17 00:00:00 2001 From: Aditya Pakki Date: Mon, 18 Mar 2019 18:50:56 -0500 Subject: serial: mvebu-uart: Fix to avoid a potential NULL pointer dereference of_match_device on failure to find a matching device can return a NULL pointer. The patch checks for such a scenrio and passes the error upstream. Signed-off-by: Aditya Pakki Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mvebu-uart.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index 231f751d1ef4..7e7b1559fa36 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -810,6 +810,9 @@ static int mvebu_uart_probe(struct platform_device *pdev) return -EINVAL; } + if (!match) + return -ENODEV; + /* Assume that all UART ports have a DT alias or none has */ id = of_alias_get_id(pdev->dev.of_node, "serial"); if (!pdev->dev.of_node || id < 0) -- 2.21.0