Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3881046ioa; Tue, 26 Apr 2022 11:34:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZRGHoIO1Pwy5jYrlpLc7yKqYVcO3JV4LQ5V+NJ25JOwGAybgoLDOCUY34l2x5JDFlSJOu X-Received: by 2002:a17:907:7745:b0:6f3:674a:339 with SMTP id kx5-20020a170907774500b006f3674a0339mr19073646ejc.207.1650998053815; Tue, 26 Apr 2022 11:34:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650998053; cv=none; d=google.com; s=arc-20160816; b=s/+7YOXKngAPjXp8S1yat2SHUnR40kuSPEJAinof8/VAhcA6tP1ZxMiKpvUuRN+yc5 ynl6ZRwTxdJ7z3Ehoofld8/zDNMuSgcXK3B4rroB2ElCKp5ZqHxVt9U2E9A2r7zXaKGg 0PX/R9x16Ii7WZ+ewdN5KHDOHOypOzDLfJCIqtSEA36AOU0wOgOfZZhDEPTePvTa2H21 YhuUuSshFd48KyC7slaP8pe/PpDDeb9Qaz/t7/rypWoKlKADu7erVVR1bysI/svIqJAw CctZBct6gsEjXceO+Xg12cCpGLunkzKVIPMrZ1hRz22i4WOlLOsDFqLCmveyMLF3p1fy QliQ== 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=Gl5BnxAhC5tv3f0q2FTVp239TTJzXH5RK6dN7MJkHlQ=; b=YPgZV9TJB/0hq3fnlfvTA0M1tHQN90WthUGoTVsMcvhx0vC+OraoKD6HuLt9HaxPdf GelKWu7NqrjypoKNVJj8ihI9caQeuwsKEXhN8fCtsCwqH5WYlTPlPhb2YoMIGwkk6jd3 N1z+obUvTP56/jgJBxpt9724jf8AiXuejQNpa4009qRb+MwM7mPvcVWbyseiMsKGy27w S/aqgi5ANmWskrUrDuPHherIg7eb3qYiEXnzj+/BAbrP8uaWvyuFsLh2UrMQqUYzZhSl vYuR95I2Rd05BkQWPR/YDya0lmd2hwI4/GIJCffXm8F/1QDj3lW1zqLUxgmsF6BU0zsR RVVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2ZAFUWIw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020a50eb87000000b00425f8cafed9si2554914edr.605.2022.04.26.11.33.49; Tue, 26 Apr 2022 11:34:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2ZAFUWIw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1345935AbiDZJCr (ORCPT + 99 others); Tue, 26 Apr 2022 05:02:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346936AbiDZIpd (ORCPT ); Tue, 26 Apr 2022 04:45:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06DF83D1E0; Tue, 26 Apr 2022 01:36:55 -0700 (PDT) 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 8D0DC6185A; Tue, 26 Apr 2022 08:36:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A11B6C385A0; Tue, 26 Apr 2022 08:36:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962214; bh=Fbabi4I2ep9mRIfgpDWVEW8fiXo08VooavgX6hur53g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2ZAFUWIw676N6FGCXmK/jFh8seC/KN+XXOzSIzdpfYwztjMddn7RaMzTmsFbR+4CZ vGo39CGr9Vrp30S498O5zZNcUb73ggU0penEeBCfXQbOa6L33KQ0RPSzCd7k01vUoj C7THSVLWi5QtYF3zgp1EeWfeCXl4ZMAHNQXkg8iY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Vinod Koul , Sasha Levin Subject: [PATCH 5.15 023/124] dmaengine: imx-sdma: Fix error checking in sdma_event_remap Date: Tue, 26 Apr 2022 10:20:24 +0200 Message-Id: <20220426081747.963991804@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081747.286685339@linuxfoundation.org> References: <20220426081747.286685339@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 From: Miaoqian Lin [ Upstream commit 7104b9cb35a33ad803a1adbbfa50569b008faf15 ] of_parse_phandle() returns NULL on errors, rather than error pointers. Using NULL check on grp_np to fix this. Fixes: d078cd1b4185 ("dmaengine: imx-sdma: Add imx6sx platform support") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220308064952.15743-1-linmq006@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/imx-sdma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index cacc725ca545..263f0466b1b8 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1869,7 +1869,7 @@ static int sdma_event_remap(struct sdma_engine *sdma) u32 reg, val, shift, num_map, i; int ret = 0; - if (IS_ERR(np) || IS_ERR(gpr_np)) + if (IS_ERR(np) || !gpr_np) goto out; event_remap = of_find_property(np, propname, NULL); @@ -1917,7 +1917,7 @@ static int sdma_event_remap(struct sdma_engine *sdma) } out: - if (!IS_ERR(gpr_np)) + if (gpr_np) of_node_put(gpr_np); return ret; -- 2.35.1