Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1225801rdb; Fri, 16 Feb 2024 08:53:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWY+sDs95tglbDjFPmcN9befe3+KCuA/20S9b+70MvFc+cls6VGx4bdGbID+5eLpr11gQsVN3/dz7dXTy048J3vPwpxrZXNxikpCAaHsg== X-Google-Smtp-Source: AGHT+IHWt6CT2IUhC8CPJGX2NHOHmJL+vfEVMR/AolyqCXSZjaEDwZ3NDxGErAuaysuTxj41Bz3I X-Received: by 2002:a05:6e02:1292:b0:363:da36:f643 with SMTP id y18-20020a056e02129200b00363da36f643mr2147632ilq.8.1708102382615; Fri, 16 Feb 2024 08:53:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708102382; cv=pass; d=google.com; s=arc-20160816; b=ko6gfnK8GYxFjkj8K9bmVnqHwe5322k+UHTXEryi20KAotLREjFLOcqN/hdOYFwJKe ZEPH0I6YtsFkWvhTBRwzIAqDzofSJTuPH665FVm8/RxslCyurYm8MVeqiutGhHgszlOs CJJZV4IyWxbdNodqQI0ZZU5csTVhYMc0roVvs775xJz22FPH/CCFnHJtzIPE22+C7tUO W2Hm6IoTff6vzJvXuznewDdti9ZLeB0Qn4VxBbZaE0JJLQ+tFCOpbQKEwK3mAhOaNub1 tKefgyUhgvv9ZimDPweSNJOmn5qRwfKEN2oEnkod3CBxbI4JPammJIU6iivvrPJWoyWQ K9+Q== 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=B2RmEH66UVY/1dhMU8IAbaHdvAaHNEGo7t2Zpzc3ihM=; fh=Z0dV6DmPh51Xs4a8D0lDPhzpUBhnVP2XSfdrjRaVLwU=; b=SZQXK/zQaTBavUtWFnBuMK1QzxCU2YOKPkCtSCWgryZyS1M0CuXKv30H4As6jO9J+V SWJj7k6OMV3UwG9VoQ+ymOTepulg8FqZ1FCh1bvmsqNfpS/gCG88ISVRi9nc0/pyRcYM ip0fkKeQs3Dr42ZLOs+nrtlyJFPx0VtqXURKBCCYe88Fp0K6Fkj9ZuKeq6Fajh5pLDFh 8SZ6JIvxxovp3XWj4LiLkH9d5MKbqqhJ2Ax11KW/KSOl7EmEdtsoazYQCzUJJkCAdTy5 CzgUrlSEeiTRdgFl6OZd1Eptvt7N6zggr+tjzpfTtelGiTA0NC+tUDKTNeDCWwHbPq5V 37kw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="t13bw/xR"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-68982-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id o17-20020a639211000000b005dccf9b1656si138216pgd.414.2024.02.16.08.53.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 08:53:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68982-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="t13bw/xR"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-68982-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68982-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 4753BB219BD for ; Fri, 16 Feb 2024 16:50:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D22BE130AFB; Fri, 16 Feb 2024 16:50:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="t13bw/xR" 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 E9B91130ADC; Fri, 16 Feb 2024 16:50:01 +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=1708102202; cv=none; b=X2Y85ub8iLC7F5UIbuzP1XtRE7PGWD10UHWzaGvMJCnyJ6TJbcftVnouzaNJsM8tBN9z8TGkL+MpALA8hwd2rcXjQ0DqM5yO2k4vnCTpxIeVEcfQ46U0w2oP4SKAQ4/z9w+WHdK/k9A/iPcPloMMrs6etCaNvFIqJfYzMhuCN8Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708102202; c=relaxed/simple; bh=SiMGhpq8b0aD4618CGwGq2cc1u00rf6CQNT2TIldlcc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VpQu8h8q+/mTdhgOrkeVmJXJSCIBCC9yA3zp9oLD+KFCn8yptrBhf8AdZVwyCedA1vhCEEqkZwijy+RYZQr8OR3HLyHX194jYSrKkRLtW8CafwLlbq+r5ATf/vdaBijRlLTofMG+amf+WwI6E4PpPhhkzi4fYKHZ8DTp6x6C9SI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=t13bw/xR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BA8CC433C7; Fri, 16 Feb 2024 16:50:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708102201; bh=SiMGhpq8b0aD4618CGwGq2cc1u00rf6CQNT2TIldlcc=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=t13bw/xRU9jFyduUY9Bns8DBfpplXuB0QbjWinrIUc8qlcrD86wb2FNtSjpBw9j29 iWvaqLf4CSz9pkLvwiuB3WMTw/hguX+0UHCJoSn0S6zGKpzU7Z4dMRufrRDPgqBZ4g wEJ0nnFsa6dy794NHVgcdmVHVQc+nOlgtAVkAmVJ06oJcr84IT7or8yz0yZpwZ9Z/+ mOLCm93vnyFsexzgtsDacq2u/bJFRpPE2bhTDoI2tJ4rbYU8r7lhD6/0eDnua1wMtK /gG7iLWgLz/IS/lLMb5fGb8d3N9jiZDtqQ6K93d9xY4TWZCNx7kEUjj1qGdjyq6z/I 6/COYMhlV+uGQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id F1D3DCE0B70; Fri, 16 Feb 2024 08:50:00 -0800 (PST) Date: Fri, 16 Feb 2024 08:50:00 -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> <20c18087-dc18-4671-b4ac-c54f7fe4ad21@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: <20c18087-dc18-4671-b4ac-c54f7fe4ad21@app.fastmail.com> On Fri, Feb 16, 2024 at 05:17:06PM +0100, Arnd Bergmann wrote: > On Fri, Feb 16, 2024, at 16:51, Paul E. McKenney wrote: > > 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? > > I didn't really try at all, I just figured I could avoid > thinking about it by using the device pointer at hand. > > I'm sure the docs would have told me if I had bothered to look. OK, a low-priority bug against RCU's documentation, then. ;-) Thanx, paul