From patchwork Tue Jan 28 14:04:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 232546 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C37FFC2D0DB for ; Tue, 28 Jan 2020 14:37:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C31E20716 for ; Tue, 28 Jan 2020 14:37:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580222237; bh=6VVs+YcJkjkc4AbeBlabJHGpjVqAyqZrDuIdDFpuW7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=A3M3JSCPXLYnV8S18aVWT9ER6SaFyzQJcwTibypo+StaKiX1qxq3UGrOheJFMpes7 c9LUpYv65n6G3fhaVRRi1MPrtTvSvdxlKxua6c/NEpNAOw5e50zTa16rl9W4YCN7tt 9h+mn9Swnl6tXCwXCNxWmNOF+f89NPPzof5CqcFU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731091AbgA1OUc (ORCPT ); Tue, 28 Jan 2020 09:20:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:45276 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731064AbgA1OUY (ORCPT ); Tue, 28 Jan 2020 09:20:24 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 37D1E24696; Tue, 28 Jan 2020 14:20:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221223; bh=6VVs+YcJkjkc4AbeBlabJHGpjVqAyqZrDuIdDFpuW7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fKoY9uCl5g5LZTu0O7S1fQC092ymXWGwdpyl4i1w/n22k6tz2//6grsDF1KyUkRww lRyWUZj508YUjlH79f0Oaq5JtbI+MBm/A2r6+r96tPVSDxhSyVSZBvqGemjThNvHcA bAz5s8TYL/TQcljD4OsFnV5TEcLXBXW0rNSnvp+A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Li Yang , Sasha Levin Subject: [PATCH 4.9 111/271] soc/fsl/qe: Fix an error code in qe_pin_request() Date: Tue, 28 Jan 2020 15:04:20 +0100 Message-Id: <20200128135900.834467580@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dan Carpenter [ Upstream commit 5674a92ca4b7e5a6a19231edd10298d30324cd27 ] We forgot to set "err" on this error path. Fixes: 1a2d397a6eb5 ("gpio/powerpc: Eliminate duplication of of_get_named_gpio_flags()") Signed-off-by: Dan Carpenter Signed-off-by: Li Yang Signed-off-by: Sasha Levin --- drivers/soc/fsl/qe/gpio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/soc/fsl/qe/gpio.c b/drivers/soc/fsl/qe/gpio.c index 0aaf429f31d57..b5a7107a9c0a9 100644 --- a/drivers/soc/fsl/qe/gpio.c +++ b/drivers/soc/fsl/qe/gpio.c @@ -152,8 +152,10 @@ struct qe_pin *qe_pin_request(struct device_node *np, int index) if (err < 0) goto err0; gc = gpio_to_chip(err); - if (WARN_ON(!gc)) + if (WARN_ON(!gc)) { + err = -ENODEV; goto err0; + } if (!of_device_is_compatible(gc->of_node, "fsl,mpc8323-qe-pario-bank")) { pr_debug("%s: tried to get a non-qe pin\n", __func__);