Received: by 2002:a05:622a:1442:b0:3a5:28ea:c4b9 with SMTP id v2csp553188qtx; Thu, 3 Nov 2022 06:47:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4WFo1xQy+wD4ieofbk4oYgnH4kO59RCMeWObKjFYpP/789t5FkUYbntSmqy5zTAHiiD1/H X-Received: by 2002:a17:907:948f:b0:7ae:1e63:5e73 with SMTP id dm15-20020a170907948f00b007ae1e635e73mr2314088ejc.461.1667483263825; Thu, 03 Nov 2022 06:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667483263; cv=none; d=google.com; s=arc-20160816; b=SAHsg+jmRKxHWD6gK8V1j1fqJstdGXKJaaqnPRbS9wNgDrSfXP9siSESxfCGTzZ3BZ K4H5XUMKxjRwdMLhfWkZHRQ8z2MqC3OYKRkT3f0C/sIAjqAF5siiKw/oLiR0WWsiRrK6 VKPuVP4mcQKrzVWW0EbDmHNIgbzcozkPnIjfnoGQthA4pQZuJNq+kg5y2kZtxXCxNnJk 0y6sJVeGP7xV78Mnmktm7fnhFIRYkVmmKYxQmGG2D5bo0DtrgoYKS/MREug4U8AfGEOV Y6abGDjR5esxWherCUrIVuIAWt5hPkyauqy3scQc7inwzk0hpPNcszgdi1srak9hXeuL Xdow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1cF8mRZUGHeivqHOZO3aUHa1pcl+bZDH00UuLqtYCJk=; b=V3l09iJt2aIKLwWQb0I6tQxz8lr1x2LwBmFH61rn9I50yizcwQmcrY3BxG+x7E8OUZ foLEeEOhBzk4tOONPjeqO8zQp+2vxQcI0NWD5+XnVTnkoyLi6tomnvXL0VoMXXqmbPwq 3ZPN1cNNtqD18fGxT1E26oyB0DxdiulAWiKYolYUuxJBQ3eqD5d4kO+zy/CHOXt6dTab DpbhlouK049S42NL7puD8BfQtq6jx796rGuV5iD0EDapn4LKw4eiivuR/l1neYVzOEQl 4hHKz/Dcb12QWpOtbvlu1aUzJ1QQnnT/Z1WI5D91pCfnOGviTIhVyvuuTGTKYASmbkbP bzxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xOlETYsG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020aa7c751000000b004634dd8b6edsi1091309eds.296.2022.11.03.06.47.19; Thu, 03 Nov 2022 06:47:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xOlETYsG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231648AbiKCNVW (ORCPT + 97 others); Thu, 3 Nov 2022 09:21:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbiKCNVU (ORCPT ); Thu, 3 Nov 2022 09:21:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17C3364EA; Thu, 3 Nov 2022 06:21:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A66AC61D2A; Thu, 3 Nov 2022 13:21:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB701C433D6; Thu, 3 Nov 2022 13:21:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1667481679; bh=fHAYAcKTHAHMfr8wTX5ZxzqFaIsOxpKhIFHKEVZZEmI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xOlETYsG0/wfqFDPYpj6x+nYNe3izo2U4hpyjJkUre1ow+rP86BhGxLhdJzpILXGj 1lRi3GucGsRso7KCKhlC04zmtI6EO666UJv+HfyLxeZtK/nHdhgO1y+JRW7cCaMwNK n4Q3oKdG+4pknanmFvqpjseNZVGFRIfnd9Om75ow= Date: Thu, 3 Nov 2022 22:21:59 +0900 From: Greg KH To: Shuah Khan Cc: shuah@kernel.org, valentina.manea.m@gmail.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] usb/usbip: fix uninitialized variables errors Message-ID: References: <76654f2f1cc30b27be10ac9b177bb449a7ad7068.1667480280.git.skhan@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <76654f2f1cc30b27be10ac9b177bb449a7ad7068.1667480280.git.skhan@linuxfoundation.org> X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 03, 2022 at 07:12:42AM -0600, Shuah Khan wrote: > Fix uninitialized variable errors reported by cppcheck. One example > below. > > usbip/stub_main.c:284:10: error: Uninitialized variables: priv.seqnum, priv.sdev, priv.urbs, priv.sgl, priv.num_urbs, priv.completed_urbs, priv.urb_status, priv.unlinking [uninitvar] > return priv; > > Signed-off-by: Shuah Khan > --- > drivers/usb/usbip/stub_main.c | 2 +- > drivers/usb/usbip/stub_rx.c | 4 ++-- > drivers/usb/usbip/stub_tx.c | 4 ++-- > drivers/usb/usbip/usbip_event.c | 2 +- > drivers/usb/usbip/vhci_hcd.c | 2 +- > drivers/usb/usbip/vhci_rx.c | 2 +- > drivers/usb/usbip/vhci_tx.c | 4 ++-- > drivers/usb/usbip/vudc_dev.c | 2 +- > drivers/usb/usbip/vudc_rx.c | 2 +- > drivers/usb/usbip/vudc_transfer.c | 4 ++-- > 10 files changed, 14 insertions(+), 14 deletions(-) > > diff --git a/drivers/usb/usbip/stub_main.c b/drivers/usb/usbip/stub_main.c > index e8c3131a8543..e1248b971218 100644 > --- a/drivers/usb/usbip/stub_main.c > +++ b/drivers/usb/usbip/stub_main.c > @@ -277,7 +277,7 @@ static DRIVER_ATTR_WO(rebind); > > static struct stub_priv *stub_priv_pop_from_listhead(struct list_head *listhead) > { > - struct stub_priv *priv, *tmp; > + struct stub_priv *priv = NULL, *tmp; > > list_for_each_entry_safe(priv, tmp, listhead, list) { cppcheck is wrong here, the code is fine, and setting priv to NULL does nothing. If it was required, gcc would have hopefully caught it, and the code would have never worked :) So are you sure all of these changes are really needed? Last time I looked, cppcheck wasn't all that smart when it came to the kernel and threw up huge numbers of false-positives, like this one. thanks, greg k-h