Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp409136pxu; Tue, 1 Dec 2020 14:32:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLI7fVBBGKyVOGrwdhcD9WZ2xR9N6DRBftDydPhB1BY9NV9WWCOWRLxpjlYrHa0kOIGRLH X-Received: by 2002:a17:906:5002:: with SMTP id s2mr5097124ejj.16.1606861966954; Tue, 01 Dec 2020 14:32:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861966; cv=none; d=google.com; s=arc-20160816; b=pwryZq9uzTCyLLyMFNl7jEJbFS9SwYwTyQ7HJFtV7Id7JfcCwuUDitG+/GcESwGocq wH6anRaeQ9RJDHAXnujuHervN6eSZK3RQcWezGmwYgYtTtVEGq3YDmU8yWvfDMag8J0y Gwlqf0Ph6qDL3vnIwrvcpQovQ5o+M9EdG/lCptsAXezUCRiKPMrRy1XdUSgdTzoYG2Fc qtIjE1PBcr2T4QD6ETnYLj0x6dAgETxhYA48NU0VZnKA6kJpOwixWfDgmRCjzW2olBzM zh9fA8dQ9z8BJv31qIYZt0lOEWsCJK6En0R20y5HjjWWzPDfkl66+nRzlpM3s/UrrxnF bPsw== 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=g8ERlvfGwG9Xjlvsl/y8GMoPlyldjwCB9twIkbzJjSbcxpPWZAYiLxCTqM74I8+vZx 2gRqTGHUr92qnLAPmDCZZq1kcKL7bpIi6LrEWYy3tBe31DqPsR1SJniy6LDz+6Inn0OW L1g401lysdQStaDtVu8vvS3d7KMS1x0qIJLbdExsXBJvFHGHEzzk6O8364uGHpZ/6kon lBfOlVc+e+lB89xUOnO6dJ3oo4GcRsZu9gDd8f2ZIRjl+Q/04MMBWav8qWrJQKzI6nwf 5+STvqMOIcqbImOcR0wmOEW57zGhSwuJg3Q6zSwfascG5xRYSEm8H/T7sehebfNonb/w uKLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sNsjyi8a; 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 u2si773486ejo.423.2020.12.01.14.32.24; Tue, 01 Dec 2020 14:32:46 -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=sNsjyi8a; 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 S1729528AbgLAJXf (ORCPT + 99 others); Tue, 1 Dec 2020 04:23:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:43594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388800AbgLAJGi (ORCPT ); Tue, 1 Dec 2020 04:06:38 -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 87283206D8; Tue, 1 Dec 2020 09:05:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813558; bh=wvaSC8J3X+XnxkAYFGxM9nb0rkFcHkxNLsvw+QZCyBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sNsjyi8atQoprc36CP/Lnuu+0XfteO0vf58E8tA6K7HbkGBuFaDGNPM1tUR1i5Dbm JLHI34V5xDWxhGbEDIFyeHYmrXucGiAktd2cJdcbQaia3hM/ya0el7LO827sBl84co v2f+v5o4hj5T6qgca0sIWiGI4fsBbiSYtd2PYKt8= 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.4 80/98] spi: bcm2835aux: Restore err assignment in bcm2835aux_spi_probe Date: Tue, 1 Dec 2020 09:53:57 +0100 Message-Id: <20201201084658.970047013@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084652.827177826@linuxfoundation.org> References: <20201201084652.827177826@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);