Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp268412lqp; Wed, 12 Jun 2024 00:25:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUgeOgxTO5D3/psMFFIMnTUPs9lz82v/eqoKZTuZADREtDFrRh5VK2GN4CvYKA+2oVSHLKDAuzPrWGDB6m/OLxaymSHRMROqPNxMwVumg== X-Google-Smtp-Source: AGHT+IFECdYT5uF5mwRhZ1yOhFjnAeXKpby0nIBf+miscZUkffSCperVxdba9qouMes8i+/TVdzH X-Received: by 2002:a05:622a:15ce:b0:440:279c:fa06 with SMTP id d75a77b69052e-4415ac733ccmr11800301cf.55.1718177148159; Wed, 12 Jun 2024 00:25:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718177148; cv=pass; d=google.com; s=arc-20160816; b=pa18xpnV6ibeeZhILlpIvwp8rN6V5MRzw20IudKsJ8d5ZzdA6roZ+UwY8PU/MsPMDZ Z+Z5PgWikB3QkQr2iaBbCOsaYSVYLO8ZZX0tv93sbcBgDrU4nGv8ZfOLNhPszTgK20NE 1QsDb4xSpz/FMFApW8X1FW2xMOmYfzhupQByE1hy1wm/L3g5Lkl8L6GRyHCVnxT6aTR5 VvR8qoCg0FE36LVB8S6HChQTEac8VOBAqiNWpzVjQQI4/HtGc+W4q2KRM0wbEDibQatA ScMGEhCDuqdTPBnYyJnU1r4rtIaEFW72ojxVbKW59nJRzwRZq7WAhKpDR66uPn9xKQJc PVJw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tzLNFDrGxRss4J5bYnxVLlo09IdLnuMkmrxSdmaendg=; fh=Br73nKN04Fn3lWtsERyLIJlWmyMXYkD1VaDZo/wTIqQ=; b=PG3AlXuqlbUUPskvVYSKEtbzyL0sdbMMkkXTrUErUs7UHQfk957KWftSnnKuDq0uRy WtpYswU7qM6SRqso7e4L/C5EK7y2nSec6hFfR6HMiDtr/xApZwAB7ccaf87a82BLL4V3 4CVTKz0Uw08X0uWtzmlAgCZ27j7RPSOWuCpJs0A6hUkSIxHigJIARszxkntTLDbsTJet WNEM8Y0WcnH0eh445uppqjzPld0NatMXVqPeiF8ZTKnes6wFzOIUDzAHr8s9wUkIPQ2m WqhjRMZNZLT1Dye+Ifey8I+XeT/8S2wWGjH0vMA5zBas5sSEt27onKEr1kiJ/86vyVpu +Ebg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xIpiJo5W; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-211069-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211069-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-4405ca0ba7fsi90413121cf.17.2024.06.12.00.25.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 00:25:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211069-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xIpiJo5W; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-211069-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211069-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DC2D01C239C5 for ; Wed, 12 Jun 2024 07:25:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42007167270; Wed, 12 Jun 2024 07:23:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xIpiJo5W" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5678616C69B; Wed, 12 Jun 2024 07:23:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718177000; cv=none; b=k25S3Ppj9SdHwY17O5r5TrRViUE10Kn4Oh0Jp/2neqmrqV/oJPrNHs0jKlOqjuZOzpfwkZBENC53yXvXzE/OzUdw45cbCCcFIzWVqLsHTWqmejZFBd20jyQ0jFXfr6V3+jNj39LDd5aeoKpmRhULm9h0c/qJ/uUI8q1mmkHJsVc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718177000; c=relaxed/simple; bh=om+CeYPKCOnLN4dmJthXsArxlQeFcaDsrz+sk8PbJrU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ft96gPOvfIeEpiUpEyH9FKbMHM+5zSnfNxPMxVA5Ogl82Y1Z5yeeF28/LIp+UevtpnV1qw8EE2ANzEP1NclPXPb//PeNojueRUgixcP84SC2b7JDAeQLC9Ds3TdewGQ6yzahVuTOx0+OrPrx3499GAFVxHs9Sd/kHaaYVU1BY18= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xIpiJo5W; arc=none smtp.client-ip=10.30.226.201 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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> 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