From: Dan Carpenter Date: Wed, 30 Sep 2020 12:27:41 +0000 Subject: Re: [PATCH] staging: vchiq: silence an uninitialized variable warning Message-Id: <20200930122741.GB4282@kadam> List-Id: References: <20200930090238.GA621698@mwanda> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Arnd Bergmann Cc: driverdevel , Greg Kroah-Hartman , Marcelo Diop-Gonzalez , kernel-janitors@vger.kernel.org, Nicolas Saenz Julienne , bcm-kernel-feedback-list , "moderated list:BROADCOM BCM2835 ARM ARCHITECTURE" , Jamal Shareef , Linux ARM On Wed, Sep 30, 2020 at 12:22:37PM +0200, Arnd Bergmann wrote: > On Wed, Sep 30, 2020 at 11:02 AM Dan Carpenter wrote: > > > > Smatch complains that "userdata" can be passed to vchiq_bulk_transfer() > > without being initialized. Smatch is correct, however, in that > > situation the "userdata" is not used so it doesn't cause a problem. > > Passing an uninitialized variable will trigger a UBSan warning at > > runtime so this warning is worth silencing by setting "userdata" to > > NULL. > > > > Fixes: a4367cd2b231 ("staging: vchiq: convert compat bulk transfer") > > Signed-off-by: Dan Carpenter > > The change looks fine, but I wonder if it's actually worse and the > uninitialized pointer can end up getting copied back to user space > in the completion. Ah... Wow. You're right. I think I really need to resend this with a more accurate commit message. regards, dan carpenter