Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4851296rdb; Fri, 15 Sep 2023 14:30:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDqGVuORJ4HSn2XoPX++kN+nii5owXjaqqCwiypmOrw1pohVOr0tT7Rh/l8g+Ntl8faXhr X-Received: by 2002:a05:6a21:789a:b0:148:1826:f834 with SMTP id bf26-20020a056a21789a00b001481826f834mr3520286pzc.54.1694813455182; Fri, 15 Sep 2023 14:30:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694813455; cv=none; d=google.com; s=arc-20160816; b=rVw3jenpcrAQU1zpDk4L1eIrIoUWBe746NMBdcMZqLy72VatUyWisf/XNtPCHWqzX7 w7LeLHlemwDO0XvkwPoHPJAXt2/NAHB76w32QfCzTNIdQl6Xd+LzG4sWX7PeHZ77pIc8 45Xv5vTQTyqHZWzj93ni5VsXJurRKCNCzRWulFeor+yeDZDWyJruCdzBLVUj58Gwh/Un VOwciB8RG9MukERH0NENPlC2M9VnMOZ4Z4e6TaMHjDu6q6NcS8SQ64EH5wbns/3K+yJ+ Tx3kl4To1nwhKPwVfwxdL5AW84wrtCjepqoSy/5yC7u4i09qeJT7PX/0LesFp12ctErd swig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=/TVQJoENhu00vx5rI/GikJKd4kuvFkeP8vi3vVfEcfo=; fh=YJtaD4NiQTD+JIVf9NDW1Nd6RoTARKge3Fm2JTbkd9Q=; b=cOljOlOaqgNBip1DZR6Ye6UCppPktmybY2EJKbQ/XiXh2iEJfsg7Fma4jwJ8vq+3qT yORCNsTGf8E2HdEptVqnqhmriA6lvZZuJpzT3Hav5d/vMuwcx4QsnwkdiSQYTndv/yHW bnC3PrVOla1PaMCtGqTq/9XzjIkgPRmEOAmZYauFBG/uo+idsvLb23fX6vzv1kx8A1QW HVoxQgxZ21Pa0K/RqXER6rXxRbF6i0ccLXjqo3HOJ3bQqBj/JdJUF/HUheTasH2djD+H VReWRQYQwISs7nxG12ifAyz6qE79XOoYKAdE25NqWpKuFjGqAca+WqphViwHComNhFOO Sz7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aym6NrPv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id n40-20020a056a000d6800b0068e3efffe2csi3766721pfv.243.2023.09.15.14.30.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 14:30:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=aym6NrPv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id B77E68310D17; Fri, 15 Sep 2023 02:50:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231761AbjIOJui (ORCPT + 99 others); Fri, 15 Sep 2023 05:50:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231307AbjIOJue (ORCPT ); Fri, 15 Sep 2023 05:50:34 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D5B03AB7; Fri, 15 Sep 2023 02:49:05 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1c3d6d88231so16519175ad.0; Fri, 15 Sep 2023 02:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694771343; x=1695376143; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/TVQJoENhu00vx5rI/GikJKd4kuvFkeP8vi3vVfEcfo=; b=aym6NrPvVQ8Sm+0tt8v2wWjHOuxq34mWO/MH9zvIWrBmb43xTjfjMe+DriZsj2t1Eo 5e93AmlnOQu5OAWuWDAYS/TQvKJmMp6U5+fc57LUgWk+uV8xILolSnPg6Zkt0CFfGFCa VnIRe1G3xEiniJueRFvXZq4XZ90dWbQNjeGfRLEt13EPTtzaVEmnr41gzj3sIyIDiQgU mfLDJzFUMvKOjzaHzdQMQhItpRo4w035ajIE0Rn5UCrVZfB+8LcnXbgfDBBVJOYFyeZt 3XFcDZNKTCC4H5fFR3O/szUhBeiGWY/zBcqvd3PeTVgQ6Ks64+XpFWNfkbK/N7FSMZag ObCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694771343; x=1695376143; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/TVQJoENhu00vx5rI/GikJKd4kuvFkeP8vi3vVfEcfo=; b=C8R1VSEJVAzKEWwk50aw8F0gGxmGkpg94JEgYK24GEOFrOriRnTXBHtEQVvqmZ3Nox pb5eCWj8fTL3Ek595KlPzxGx5hAzxowtf3tWtMQjgG0VhpVPBVPOmtRfWBy9QRw8J7DI d4Jq+nRvoF8o8nNOQK/W5909w2Lp1Tzc4D6TsGQghFY/U7bFvq0OASCkwAyGxMSZYGFr ULSlPc+qwtUa610A58R0SL87UPAtH0unkm3EkBakl/GcHOojxqf4EAm4qWeFFZkwSRuY RDM+uKBGkY3Ae5jbZpnkCkJQsLFxXlMp3XcWsrF5mVXWvoxRgY6H/Gzh1XqBNG9XqtUf tlAw== X-Gm-Message-State: AOJu0Yyw8oYmSjjY4FjBe4kCnXDyUvWPtXis66ep6I7lA0BYE+e5RAGt JjBlhV3f+ckMqnW7rWRkddE= X-Received: by 2002:a17:902:e9d5:b0:1c1:f1db:e86d with SMTP id 21-20020a170902e9d500b001c1f1dbe86dmr880494plk.7.1694771343330; Fri, 15 Sep 2023 02:49:03 -0700 (PDT) Received: from [172.19.1.47] (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id 12-20020a170902c20c00b001b8c6662094sm3062686pll.188.2023.09.15.02.49.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 Sep 2023 02:49:02 -0700 (PDT) Message-ID: Date: Fri, 15 Sep 2023 17:49:00 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] tty: serial: ma35d1_serial: Add missing check for ioremap To: Chen Ni , ychuang3@nuvoton.com, schung@nuvoton.com, gregkh@linuxfoundation.org, jirislaby@kernel.org, ilpo.jarvinen@linux.intel.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org References: <20230915071106.3347-1-nichen@iscas.ac.cn> Content-Language: en-US From: Jacky Huang In-Reply-To: <20230915071106.3347-1-nichen@iscas.ac.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 15 Sep 2023 02:50:37 -0700 (PDT) On 2023/9/15 下午 03:11, Chen Ni wrote: > CAUTION - External Email: Do not click links or open attachments unless you acknowledge the sender and content. > > > Add check for ioremap() and return the error if it fails in order to > guarantee the success of ioremap(). > > Fixes: 930cbf92db01 ("tty: serial: Add Nuvoton ma35d1 serial driver support") > Signed-off-by: Chen Ni > --- > drivers/tty/serial/ma35d1_serial.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/tty/serial/ma35d1_serial.c b/drivers/tty/serial/ma35d1_serial.c > index 465b1def9e11..4a9d1252de35 100644 > --- a/drivers/tty/serial/ma35d1_serial.c > +++ b/drivers/tty/serial/ma35d1_serial.c > @@ -695,6 +695,9 @@ static int ma35d1serial_probe(struct platform_device *pdev) > > up->port.iobase = res_mem->start; > up->port.membase = ioremap(up->port.iobase, MA35_UART_REG_SIZE); > + if (!up->port.membase) > + return -ENOMEM; > + > up->port.ops = &ma35d1serial_ops; > > spin_lock_init(&up->port.lock); > -- > 2.25.1 > Thank you for this update. Acked-by: Jacky Huang Best Regards, Jacky