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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 322C2C27C75 for ; Wed, 12 Jun 2024 07:23:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tzLNFDrGxRss4J5bYnxVLlo09IdLnuMkmrxSdmaendg=; b=M/7PIsy1YQzwkDpVW29Bnpyqig oUFpm9bijCVSICkFdwsdUMCnGQlO06+6FqRWBZnbXcdCaG42lMdk/Le1I8CpG75ZHuDcX014O9CPR xJceVLoK/fdg2SWBog23Qa6cQQ2PCFXq4oQcWiHL+AOUG2px5xMbko2EwwchfpCK3sMRng9K5smQA D3G66iRlQn+zy6HTCRYi5nlcLi+wUVqHanj4TLJozofDcBRsISKb5O6NYkNHJTtSMNZ1t0XYPTkAt 51r5Orhce9DGJulaupQoYhshhI5+3A0EvueQtrfMqSDtEKXMz5NCR0BtEoUCBcfrq6Vo2f8p0/VXz QPFEkP4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHIKJ-0000000BPRg-3X51; Wed, 12 Jun 2024 07:23:23 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHIKH-0000000BPPq-30Qz for linux-arm-kernel@lists.infradead.org; Wed, 12 Jun 2024 07:23:22 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 31D1C612A8; Wed, 12 Jun 2024 07:23:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 812F0C3277B; Wed, 12 Jun 2024 07:23:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718176999; bh=om+CeYPKCOnLN4dmJthXsArxlQeFcaDsrz+sk8PbJrU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xIpiJo5WPsePjV0XEHViYmADYGGw0Idy1sMoarLMMycZPYsGnbCmYEKb+AaATfUwe gaCMrTv/JB9y9Q/QIROz+iqz6InfM41GKjziRU40+ChL0guUgFHm0j3lo+onhQVuSD xHt4denCAz7zylMLbfOM5zTb5A9snk6Z6HNQr/N0= Date: Wed, 12 Jun 2024 09:23:17 +0200 From: Greg KH To: Jacky Huang Cc: dan.carpenter@linaro.org, jirislaby@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Jacky Huang Subject: Re: [PATCH] tty: serial: ma35d1: Add a NULL check for of_node Message-ID: <2024061226-laborious-jubilance-8df8@gregkh> References: <20240611092251.159149-1-ychuang570808@gmail.com> <2024061118-sycamore-leggings-05a9@gregkh> <73d2167a-84ee-40a4-a68d-ba25229ff8ce@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <73d2167a-84ee-40a4-a68d-ba25229ff8ce@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240612_002321_816405_F8276C81 X-CRM114-Status: GOOD ( 25.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 12, 2024 at 08:43:54AM +0800, Jacky Huang wrote: > Dear Greg, > > > On 2024/6/11 下午 07:11, Greg KH wrote: > > On Tue, Jun 11, 2024 at 09:22:51AM +0000, Jacky Huang wrote: > > > From: Jacky Huang > > > > > > The pdev->dev.of_node can be NULL if the "serial" node is absent. > > > Add a NULL check to return an error in such cases. > > > > > > Signed-off-by: Jacky Huang > > > --- > > > drivers/tty/serial/ma35d1_serial.c | 13 +++++++------ > > > 1 file changed, 7 insertions(+), 6 deletions(-) > > > > > > diff --git a/drivers/tty/serial/ma35d1_serial.c b/drivers/tty/serial/ma35d1_serial.c > > > index 19f0a305cc43..3b4206e815fe 100644 > > > --- a/drivers/tty/serial/ma35d1_serial.c > > > +++ b/drivers/tty/serial/ma35d1_serial.c > > > @@ -688,12 +688,13 @@ static int ma35d1serial_probe(struct platform_device *pdev) > > > struct uart_ma35d1_port *up; > > > int ret = 0; > > > - if (pdev->dev.of_node) { > > > - ret = of_alias_get_id(pdev->dev.of_node, "serial"); > > > - if (ret < 0) { > > > - dev_err(&pdev->dev, "failed to get alias/pdev id, errno %d\n", ret); > > > - return ret; > > > - } > > > + if (!pdev->dev.of_node) > > > + return -ENODEV; > > > + > > > + ret = of_alias_get_id(pdev->dev.of_node, "serial"); > > > + if (ret < 0) { > > > + dev_err(&pdev->dev, "failed to get alias/pdev id, errno %d\n", ret); > > > + return ret; > > > } > > > up = &ma35d1serial_ports[ret]; > > > up->port.line = ret; > > What commit id does this fix? > > > > thanks, > > > > greg k-h > > This patch fix the in tree ma35d1 serial driver. > The last commit for ma35d1_serial.c is > '6b64f8e360c00f180cffa1806095cdd2abc55b16'. That is obviously not the commit that causes this problem, which is what I was looking for here. Shouldn't you include a "Fixes:" line if this is resolving a bug? thanks, greg k-h