Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3547740pxb; Mon, 24 Jan 2022 11:57:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJy7DOKwawpkBSnAb/cnvYToXDjNUYyjtOevV5zb+ofpVm6ntErCpovTN38RPalmxEvJzqUx X-Received: by 2002:a05:6a00:22c3:b0:4c8:55f7:faad with SMTP id f3-20020a056a0022c300b004c855f7faadmr8816593pfj.86.1643054260504; Mon, 24 Jan 2022 11:57:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054260; cv=none; d=google.com; s=arc-20160816; b=pPyuK7bT9A5QQ+BjXkJpHV0aQFOa4zHcAYNgbH+9gqPq6wKESqcX27In53sJfwbD1Y 17FzD9nqFji/k3LxpIKVgL7AP52aCB14G6rLKc2o7/q+tvGWUDDHDWo6NWX0bPxartVz JIM9BAQQsyQ1azv4nmy+PkERmucEdgfqWuCnT7ofmGI+/57wE1Yy3yFMeTgtQp3kBGEE F6Vk66kBwadQ45uUUf35/C9CTIONEy6Pq1fFhRZvgxmcl94xudss/ixFZxSmbm5egZAy xQe8X5fhha8je8rXK3Ik2WwAWZT/DlPgi016a0Z30kS3FoSw8zbbGPyJerYUV9gG93wV VtRQ== 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=SyJWq44XTVW4Gp4nQtDUQxNC7PUdkbddFjnV4Ar69nM=; b=SMMdhmI9XTejvQEDuBNqqxgcKiogzz5d0H6wvAoiruvVwl1pFP2kYdSUFZLJmkGpFA vS1d5p/YRRy9VlIHqrDAZ94J+Hx933siuH+/9rzB1C2BZb2ZcN4RAiNw9VOBhcRQOl1M S3DW7w/tQf7xNqO2gc3Y09DaodwA0w+UrM8CzJTpmWoAdU1RMV1pDJtdhKpchqR354R+ Nj+t4gsrIZsv0PGpwJKlGFUmTnZNmfWHEExhsbtuwYohHfDY4Xx8Mz16haJuLNYcAjdL Y54/lhU/QbLEWr1CUSdWrWjKdkDnD0PBTL/LKPUqk854QdE26Sw1gs6s3aZB2MFa9v3U JBQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JZukpkwV; 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 l1si715944pff.40.2022.01.24.11.57.27; Mon, 24 Jan 2022 11:57:40 -0800 (PST) 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=JZukpkwV; 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 S245695AbiAXSv3 (ORCPT + 99 others); Mon, 24 Jan 2022 13:51:29 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:48420 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245638AbiAXSuS (ORCPT ); Mon, 24 Jan 2022 13:50:18 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7AB79614FB; Mon, 24 Jan 2022 18:50:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60ABDC340E5; Mon, 24 Jan 2022 18:50:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050217; bh=vZjh1a99CF8nIXVH4rDeTL1IpxVOUgeFv9TdLR4y08c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JZukpkwV+6kBsp4mLQoLdRDJaH3E/pC/UwlVSeen34VGBqO09ZyqzyNP3hDgLUeiV 1JN+VvHgJEjn4N4u/+yCp+Y3gUJMh/tAZhToDm8baaJ7Wulvq6GSseslBB3473hy5H D1WmyO3vfcj6xeratxG7dJ6jFnld3qz6m6wLGaUg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peiwei Hu , Michael Ellerman , Sasha Levin Subject: [PATCH 4.4 046/114] powerpc/prom_init: Fix improper check of prom_getprop() Date: Mon, 24 Jan 2022 19:42:21 +0100 Message-Id: <20220124183928.526538761@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183927.095545464@linuxfoundation.org> References: <20220124183927.095545464@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: Peiwei Hu [ Upstream commit 869fb7e5aecbc163003f93f36dcc26d0554319f6 ] prom_getprop() can return PROM_ERROR. Binary operator can not identify it. Fixes: 94d2dde738a5 ("[POWERPC] Efika: prune fixups and make them more carefull") Signed-off-by: Peiwei Hu Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/tencent_BA28CC6897B7C95A92EB8C580B5D18589105@qq.com Signed-off-by: Sasha Levin --- arch/powerpc/kernel/prom_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 3139533640fc8..204e44cc896ec 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c @@ -2526,7 +2526,7 @@ static void __init fixup_device_tree_efika_add_phy(void) /* Check if the phy-handle property exists - bail if it does */ rv = prom_getprop(node, "phy-handle", prop, sizeof(prop)); - if (!rv) + if (rv <= 0) return; /* -- 2.34.1