Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1188782rdb; Fri, 16 Feb 2024 07:52:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXCDEpmf+UNtnwI7LWL8Vvc8MchGGskMPO+H+ijDO8S14YkVwLRw2tQrrY2nH3OY291tOtbaJNZpb0pjf+2P4vXjnf1ZJgDzT0FNTH+eg== X-Google-Smtp-Source: AGHT+IGOmDv7FDICYr8iQdAfZzYlmyzqiUfi9DtLwoNnrcwhrxYoro1tmE9e2qPktPLur4GpHET3 X-Received: by 2002:ae9:e201:0:b0:787:2691:44 with SMTP id c1-20020ae9e201000000b0078726910044mr5167007qkc.16.1708098725506; Fri, 16 Feb 2024 07:52:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708098725; cv=pass; d=google.com; s=arc-20160816; b=RpnGY+rTZINlmz6ph64DJ9PA8MO+LncjMACGvgYRUyKYgC8USQyqwE5hyk+ZHHiIko sAmITHSKD+ayUMwzvmvmM+9ELT7sRHE4hbV15QKvvWaSk1GliBUQct4uB7DHQ+oNXRat k3xKgPjAelb5V7S97bpVnRHL4MF/EF/6iM9TVdXCaYwS4Mwjp9dKOkDWzrvJc32P6l2n FhvAlpoeUh8Y/tX3K4ZT/Eh7AFyqTXe5aPhFsdou4u7a/4JUobAN1mD46x35EYcEEnle Jlk/cadtjjxq9Gdd/gAwpznPWcg9xFrUazTGENC1rn9zVO93EAHBlydgZx7WD3uJIpEg L3jA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Sxi9O/Sv+s1YuVPC+sVFJMNP+LracuyAUapS8974Fe4=; fh=Z0dV6DmPh51Xs4a8D0lDPhzpUBhnVP2XSfdrjRaVLwU=; b=qpmN8eVv2yt7MRR6RibWuoFlOFpKJvFGUBwEX+gX2joRMbm0jgu7RuBpBXEAmPfeMZ Js82rMAL9Q/W82EcH//8uVqMi9suQEsmJONSbtJ9Ef92avutoznUFtHYcHdEiBSUCL5R /a4ir8wgiNlPjD2J4S8nNaq5O5FZohtNWy8MclOwPuc0E2z6eHtEAYeTh7o8UEcgtLJB hpMAzlvcoNVPjAA6RLTtXmMsrae/Uf84fqXQuo+wSQiN9odSD/NAoUrHqlzduIBt0EiR HF5+q2/anbQGPqVS5ysL7A14gK5jUXMTMDg0fMO0/yaBMYnURD5EUQ2pH0g+QUqs4F/x L90A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XCvBItEq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-68905-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68905-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id x3-20020ae9e903000000b00785ba13fb90si156217qkf.152.2024.02.16.07.52.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 07:52:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68905-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XCvBItEq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-68905-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68905-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2C6321C21511 for ; Fri, 16 Feb 2024 15:52:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F299B12FB06; Fri, 16 Feb 2024 15:51:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XCvBItEq" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21B6112F5B2; Fri, 16 Feb 2024 15:51:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708098717; cv=none; b=JrNimouaOSi4/s/2ABVNHPFi3/2f2GCMEXoicNpSjGT/BO7UvaCvnOQf/doiPnlG4HB9uEgFwuodJbkGNbVn76ikMTmZFmr3hpCMbVDgcwAmUKSaL9yyytNMb0Y/47gM0yYGmP8eVsCjjwa03Yo+4uQa/07XFD26hBxkSpZ6XMA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708098717; c=relaxed/simple; bh=fWMKxBO0fPH9y+BU98ESj2z/A6lChdT3LPjmK4IL36A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=U3DBBsZ34jNAjMdOFCsQIKuTR/1ZCUTLxyH1gj6hULHgvu7eutx9bg1C29fC8bjdCUxFfFtFgxRbvw1hUTd9BrmM33aAV2R4pFfJuxcxoz/ekLTTpgxzWR8ID+gSFLUzWqa18AqhnaHvQbvGPyRYOnRoYmCWRqEgZfbcEYwnQf4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XCvBItEq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98905C433C7; Fri, 16 Feb 2024 15:51:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708098716; bh=fWMKxBO0fPH9y+BU98ESj2z/A6lChdT3LPjmK4IL36A=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=XCvBItEqD7EqI8/MmaowEbXueSX7rwbd4eQ4HxgTKRHpWoDKGYvR7yi/JaXcBs4sx eTmLH+UErL5BpDG6hqzls0w4iMQQNSEW14ioHVx5zdH6QEds7l617U3iaiR1Qm5R/9 inNNdskjG+oc9kpriSmH3s2H9SL78GH4RuvPExZnDlBkK73JCsGOU8fY8ZCF6wG1eB i7QYGWUoxAjyhlSKUiXM0MTBt4zRELfBPXCqKndQMJovISeidz79gjNmwLkq1VK5La IBZVTDC5mIqOp4aL0wcgIz+ICd0bfVDhMEm1jkEgl/8BsJsmBzgWWHky/lMuO2rgDX mCCZ5XlcaGL5Q== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 332E9CE0B70; Fri, 16 Feb 2024 07:51:56 -0800 (PST) Date: Fri, 16 Feb 2024 07:51:56 -0800 From: "Paul E. McKenney" To: Arnd Bergmann Cc: Bartosz Golaszewski , Arnd Bergmann , Linus Walleij , Kent Gibson , Andy Shevchenko , "open list:GPIO SUBSYSTEM" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] gpio: cdev: avoid uninitialized variable dereference Message-ID: Reply-To: paulmck@kernel.org References: <20240216125959.3766309-1-arnd@kernel.org> <14ab7b63-b2c0-41e3-8104-da5515b379be@app.fastmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <14ab7b63-b2c0-41e3-8104-da5515b379be@app.fastmail.com> On Fri, Feb 16, 2024 at 03:04:14PM +0100, Arnd Bergmann wrote: > On Fri, Feb 16, 2024, at 14:19, Bartosz Golaszewski wrote: > > On Fri, Feb 16, 2024 at 2:00 PM Arnd Bergmann wrote: > >> > >> From: Arnd Bergmann > >> > >> The 'gc' variable is never set before it gets printed: > >> > >> drivers/gpio/gpiolib-cdev.c:2802:11: error: variable 'gc' is uninitialized when used here [-Werror,-Wuninitialized] > >> 2802 | chip_dbg(gc, "added GPIO chardev (%d:%d)\n", MAJOR(devt), gdev->id); > >> | ^~ > >> drivers/gpio/gpiolib.h:277:11: note: expanded from macro 'chip_dbg' > >> 277 | dev_dbg(&gc->gpiodev->dev, "(%s): " fmt, gc->label, ##__VA_ARGS__) > >> | ^~ > >> > >> Use dev_dbg() directly. > >> > >> Fixes: 8574b5b47610 ("gpio: cdev: use correct pointer accessors with SRCU") > >> Signed-off-by: Arnd Bergmann > >> --- > > > > I seem to have beat you to it[1] and my patch doesn't change the log > > message so I'll apply it instead of this one. > > Ok, thanks. I thought about doing this, but could not > figure out which of the RCU primitives to use. I will count that as a bug against RCU's documentation, but I am not sure how to fix it. Thoughts? Thanx, Paul