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 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 37ADEC43381 for ; Tue, 19 Mar 2019 14:44:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F215420850 for ; Tue, 19 Mar 2019 14:44:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553006679; bh=/CrynR69MqMOhWcpORKq2/wJvPRdl64cyeDOedIv6pA=; h=Subject:To:From:Date:List-ID:From; b=juwBAT8qUBw9jApMCALGR64oywUuFuI5P8Ngb1KTTaUJmCEEB3Uj57uESKwzr1IOV wKDpTJdqctTpCH68PK7/9waPYhQ9ow/yUsFG2i53XijHZ6rcerMn+9TytwhNjsYnQh jjbq1K507DbqC9DRwbf8LyP592p7bpOUTAW+iZuI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727127AbfCSOoi (ORCPT ); Tue, 19 Mar 2019 10:44:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:56048 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727145AbfCSOoi (ORCPT ); Tue, 19 Mar 2019 10:44:38 -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 17F5220850; Tue, 19 Mar 2019 14:44:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553006677; bh=/CrynR69MqMOhWcpORKq2/wJvPRdl64cyeDOedIv6pA=; h=Subject:To:From:Date:From; b=PD5UeUjZK90Z87dq/5oT49Xxv8LyOo/nAxQJbyZJe23frPLkTBq9MoRnQgAejvQDd JcNuKrlUSL2vbC5nKl2fL4yhIHmgQS9FQqDz5DFao8MiO++eh+Q/eXJWpShkGRC/ub 84+wx+KBj4XHQ7Z6g+0I6yxAz25GZf8XenL1I3wo= Subject: patch "tty: atmel_serial: fix a potential NULL pointer dereference" added to tty-linus To: kjlu@umn.edu, gregkh@linuxfoundation.org, richard.genoud@gmail.com, stable@vger.kernel.org From: Date: Tue, 19 Mar 2019 15:44:26 +0100 Message-ID: <1553006666121122@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: atmel_serial: 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 c85be041065c0be8bc48eda4c45e0319caf1d0e5 Mon Sep 17 00:00:00 2001 From: Kangjie Lu Date: Fri, 15 Mar 2019 12:16:06 -0500 Subject: tty: atmel_serial: fix a potential NULL pointer dereference In case dmaengine_prep_dma_cyclic fails, the fix returns a proper error code to avoid NULL pointer dereference. Signed-off-by: Kangjie Lu Fixes: 34df42f59a60 ("serial: at91: add rx dma support") Acked-by: Richard Genoud Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/atmel_serial.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 05147fe24343..41b728d223d1 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -1288,6 +1288,10 @@ static int atmel_prepare_rx_dma(struct uart_port *port) sg_dma_len(&atmel_port->sg_rx)/2, DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT); + if (!desc) { + dev_err(port->dev, "Preparing DMA cyclic failed\n"); + goto chan_err; + } desc->callback = atmel_complete_rx_dma; desc->callback_param = port; atmel_port->desc_rx = desc; -- 2.21.0