Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp407933pxu; Tue, 1 Dec 2020 14:30:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPO6nEE9RCXfhxoQJ61TXskj3ebiLMOGF43WS911OHvUeyhDJA4lAyy/Wq21gOa3FpLcer X-Received: by 2002:a05:6402:1153:: with SMTP id g19mr5380864edw.312.1606861845650; Tue, 01 Dec 2020 14:30:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861845; cv=none; d=google.com; s=arc-20160816; b=OBCpknhD0/nSo6hjUrqDeYcgy2z1s7PZpmEZ4KvW6TAUMlmWCvXonn9YlDZCsbirO4 6lNgwsSzaR2Gv+skUdAOHpwfV2ZJfLwncYJKUjHfO906wolLd/b6QgEUsxQI+1B3TXBu BegmohvuzNcqt1YNWKyjLGxEZxJ08fqHNFpQB5NBQExVFWmhk9y4/mYeG6EzSfoLyZPq N2vI++mhvbc11z8vtoriB74kkteL6wle5c7dV9Ly0L1lWd4Tc4hm0IJaJrZ/Iv5Nalu1 U82rmnEtekt3zNIk9yKcxKEoPu2AQhvMbzq9/zbKBvudo8pBFShKT8rGRWek/wN2mgk8 3lJA== 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=JV0Mx2RaHySfjzMicf5QfPOGm1Xp4AOvbe9YCuaIOrA=; b=SJwG5vu3gV630jlTzIlc0zazCoovvc3Si7qf6ros4W8mnEdAiP1nXf6dzgP8e/Dynd 8+NKWFtQh97SD5yz3YME9556iutOg2qrVDQCxt5pRRJFOKpWzt+F1H8pg6LDwiU0jjp1 w2TtBvuS/Dkj22pcWlTTgvnTM7HiQka/BEzZc0vbx4waXJe6LrpBRajXW8UbXQKg3mU5 NWKsRIYMOkZAuSzMajmT/MTjkTVUqWsSPQzQTIYttwuqEPHbh32u5s/kt0Sotg38FwE2 2P/ynG72yfQyDghneCe7up17iXyCk4xI1qW8RHZPPCQewYEqCZ64jYm+4qWc0dAQwGH+ SMJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=afIBiMWb; 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 g16si818011ejf.167.2020.12.01.14.30.23; Tue, 01 Dec 2020 14:30:45 -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=afIBiMWb; 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 S2390466AbgLAJP2 (ORCPT + 99 others); Tue, 1 Dec 2020 04:15:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:53534 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389850AbgLAJPA (ORCPT ); Tue, 1 Dec 2020 04:15:00 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 D4A2420671; Tue, 1 Dec 2020 09:14:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606814084; bh=wvaSC8J3X+XnxkAYFGxM9nb0rkFcHkxNLsvw+QZCyBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=afIBiMWb/z2I6wJU2Ov8qIZGM5xtW/+1OnwGeHooL35bNCKRkZLO4gOfo2Bjb4cMh RM9FUuWnOdScqH+WEWWdgwd644kkW4dsgJaEJ2gdcMhrWisomA7xeDVSoNOVr7B75b uo5kpYuNcB2yiECM1a/3N6w8hv4w5GYIfl0Dwm3Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Mark Brown Subject: [PATCH 5.9 141/152] spi: bcm2835aux: Restore err assignment in bcm2835aux_spi_probe Date: Tue, 1 Dec 2020 09:54:16 +0100 Message-Id: <20201201084730.280519966@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084711.707195422@linuxfoundation.org> References: <20201201084711.707195422@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: Nathan Chancellor commit d853b3406903a7dc5b14eb5bada3e8cd677f66a2 upstream. Clang warns: drivers/spi/spi-bcm2835aux.c:532:50: warning: variable 'err' is uninitialized when used here [-Wuninitialized] dev_err(&pdev->dev, "could not get clk: %d\n", err); ^~~ ./include/linux/dev_printk.h:112:32: note: expanded from macro 'dev_err' _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~~ drivers/spi/spi-bcm2835aux.c:495:9: note: initialize the variable 'err' to silence this warning int err; ^ = 0 1 warning generated. Restore the assignment so that the error value can be used in the dev_err statement and there is no uninitialized memory being leaked. Fixes: e13ee6cc4781 ("spi: bcm2835aux: Fix use-after-free on unbind") Link: https://github.com/ClangBuiltLinux/linux/issues/1199 Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20201113180701.455541-1-natechancellor@gmail.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-bcm2835aux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/spi/spi-bcm2835aux.c +++ b/drivers/spi/spi-bcm2835aux.c @@ -529,8 +529,9 @@ static int bcm2835aux_spi_probe(struct p bs->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(bs->clk)) { + err = PTR_ERR(bs->clk); dev_err(&pdev->dev, "could not get clk: %d\n", err); - return PTR_ERR(bs->clk); + return err; } bs->irq = platform_get_irq(pdev, 0);