Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4593314pxj; Wed, 12 May 2021 08:52:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwp3mhtIdWZ47v/FFDYIqIV+zSRAFUXt5kzLUjsMDzcKIP4LtQYI4v8vA0MNMU9H8ijcbhk X-Received: by 2002:aca:c792:: with SMTP id x140mr16215998oif.88.1620834767765; Wed, 12 May 2021 08:52:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620834767; cv=none; d=google.com; s=arc-20160816; b=A/p859dlmH50UYM3vMBHqf/DZS9GiV5mhtoQ5VteqkGEHojCPI4gtaUPlMyIfRT1as PB1q/h1LXzKTrQt/eA30d3VnPc2j1D4Xh488kq0Z0q9APIsOnc4T0Fpjm1sCSBvDnzzd kj7jq+Y/AQbdHBfkJmK6rEH2SGDWd7YFc2kBhoYa9aTQcBGZBHn53aIUV8o7OzOqOCJd AiNHbpACGjDsrzdZDJRH5Ep18WbuiYLEXrj/9Xin3hTvhMORR3bGSIj3bSquw2nmBJha J6bxS+dRJ/7f12G3sX8mhh65Pxf7EtlZJnlWkMvHO39JyAORI9eXNZencZB8a/lGdAKo vxIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eYDhNk6Ioz5SZRW3T0aneaaLoUEZ86Mzuh59vZ33KH4=; b=MefsXlh6oPND+ru91LQRV6lpF33d1kScYKp7Q4vMT3sYMaUtz6nSOHV3ycJ9jpKjtR +3phk/CJi3OPlq06ataUv5x26x195YV+AI0vFfNM/u3ReO+/W8uc0BLF0af3HyBJMG1c aQxme6aZE36+1dYEzBf1jgoX5qYsJUyzKUwMVYf6HD8WjUqmxZmfByx29rCravj7igCV m0/oeP7A13HaT8IkCPqdiNF5hOUN5vvVPZzZmLx4bGQLMHHpjXahLeje6K/7CllHFI4o lbn6FAqmiQvB4nFKfo3LcBrH/Vjv1VBEblK1BJi7GsZFbVHsnH9NNOHepCbxOAhZF+06 RATg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WhmPoEVI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w110si222451otb.53.2021.05.12.08.52.33; Wed, 12 May 2021 08:52:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WhmPoEVI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237211AbhELPsz (ORCPT + 99 others); Wed, 12 May 2021 11:48:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:37004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233872AbhELPXK (ORCPT ); Wed, 12 May 2021 11:23:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1B9FA615FF; Wed, 12 May 2021 15:09:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832175; bh=SLWMs1rpk2WPhOcuh68j6BUTGqVBRlq2b1IEtVLBjDM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WhmPoEVIOsX8obamj4dlBjaL5NbfK3/E7adGgfjTRorb9MQn/7spen/1IHojV08CR dWyU6u9E5Qal6+HFFWDtdkkm7QW48bYx659c1FSx6U7XlH0HZIQB8h0jUhac2UhYKL ytWoIs6SNuBihQMcipPD7uhVialYNIlbNawPEZZc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Heikki Krogerus , Amelie Delaunay , Wei Yongjun , Sasha Levin Subject: [PATCH 5.10 145/530] usb: typec: stusb160x: fix return value check in stusb160x_probe() Date: Wed, 12 May 2021 16:44:15 +0200 Message-Id: <20210512144824.589975406@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wei Yongjun [ Upstream commit f2d90e07b5df2c7745ae66d2d48cc350d3f1c7d2 ] In case of error, the function device_get_named_child_node() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family") Reported-by: Hulk Robot Reviewed-by: Heikki Krogerus Reviewed-by: Amelie Delaunay Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20210308094839.3586773-1-weiyongjun1@huawei.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/typec/stusb160x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c index d21750bbbb44..6eaeba9b096e 100644 --- a/drivers/usb/typec/stusb160x.c +++ b/drivers/usb/typec/stusb160x.c @@ -682,8 +682,8 @@ static int stusb160x_probe(struct i2c_client *client) } fwnode = device_get_named_child_node(chip->dev, "connector"); - if (IS_ERR(fwnode)) - return PTR_ERR(fwnode); + if (!fwnode) + return -ENODEV; /* * When both VDD and VSYS power supplies are present, the low power -- 2.30.2