Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp1018687rwl; Fri, 4 Nov 2022 08:54:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5q2ZUMs9TYDpMMxYTzn6TXfap93zhThmEjgEEEGwdSons6GjGgf2YUrKsGitPj3g8QW5o8 X-Received: by 2002:a17:907:75f4:b0:7ad:b868:ccf2 with SMTP id jz20-20020a17090775f400b007adb868ccf2mr32119414ejc.733.1667577268056; Fri, 04 Nov 2022 08:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667577268; cv=none; d=google.com; s=arc-20160816; b=wroLVfXfOJUgFtiGcwdp1IjcYtayoSmGBwlYt+ppIPFwK5kvPs8C5AazyjRjjWKTUo nS4G1MVAP4+82qey13sCkxKuUUOm4iIMQZLEnMJcAW+Wc+PrLaKMgBOEVktLcoz9hIJy Co+VHVsUYYBkyP1wkWKNZX2N5NvT3y+cc05pkE6wMscunbEzjbMaZtHmIFnv7xohfp8Q NxNJc7BHhV6oNyd7M22rlzymcPMVG4wdmWwtYGwy+2VAjRVEXrm2Q1s+6viwQvo7BXT4 tP9i5dEmoygele57c7N4PlROVYKpLsGXsfTJvLTNt0TnuUcPN0UCvF2nBZCskwp9hxbY U+fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=vdYOviAQx89yxTqP8I/2vP959IYnbzOSiQXvLwhkYv8=; b=qGv1vFL1+x3FsXU2F/epq4Hq/BlkJOAMi4Lfzuq0A3x5mN0phDSiVMAlAoza4aEr5v uAZsU2j4UvJTTHDslDy4qc3DPfoUNSfVNHluezYS7yPoMMkX4TIKMGAWKlVmj6N2rMxu 5mNdH4zc3A1C9qQ/tzw8YPqdAexVRiL7g9ggFzlBHSp3OAUM2LV14RRcVWEEZftkj0vS pGA5rSHepddYnZiQKaU9u5UQeNjQBtUnTyx9tal557ziH2+lPEiaqcGZEgIzChzcWnxG 0P+fS7NFe14UaqzH9cnEbotQ8D8/z5/0gdWgplZeI/PiNjK32LeopXdt9UX7HcyR2ftc 3INA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Hz0aO6DN; 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 p34-20020a056402502200b00458d5d907c6si4459709eda.514.2022.11.04.08.54.03; Fri, 04 Nov 2022 08:54:28 -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=google header.b=Hz0aO6DN; 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 S232498AbiKDPSf (ORCPT + 96 others); Fri, 4 Nov 2022 11:18:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232481AbiKDPSU (ORCPT ); Fri, 4 Nov 2022 11:18:20 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 193512497D for ; Fri, 4 Nov 2022 08:18:19 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id h193so4611830pgc.10 for ; Fri, 04 Nov 2022 08:18:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=vdYOviAQx89yxTqP8I/2vP959IYnbzOSiQXvLwhkYv8=; b=Hz0aO6DNjl8dua2dkdqX2SMbs8U9SZluEHymOISTkL0IYkWQv4CLNPpyt8ak5S5wVW SDVmOdnDiNb2eNvxNqwHoVLMW86egSJJBzqENrEx/ckb34Vi6rfZuY/ctCZNAGIZKhey Wzl14aMKC8OfL98AgVonUxAAKKbgrJMFiaQpo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vdYOviAQx89yxTqP8I/2vP959IYnbzOSiQXvLwhkYv8=; b=E2Ic1tVINupWyVBpnRwp/AmpRGEwslHgRfjvfiKLvc+YgjFmofvkhpDyGuNuMoYc0z XcmiLhfGHkO6OicoTEs2CgbgRPO3GQ86s9X8lD6gnFYv8NzyU0y3BtIwWV/Fflt2Ziou rdMmvhw3/3DwPAnMFjw3Ybw3jW5bgn2eA/lzzZZZOgp0/vB79Q4nyf1x1RyvMuGq7fpA qrGSIjTW+qX273tDPsA2fv72zUX0hwfTXP5nLo1CgzFj6XJtrtk1SFzjXlAXBUt01IVe 83VdpbLw2oOfUdBN+kSL8H/XRu2Firvex+M+xE3yeSvqXLvLe3doojL66fhua/6xwJHf +/UQ== X-Gm-Message-State: ACrzQf02Rzdu2xT1OURTb36apW2z4MqpDVc+A1GljB6cLUeUFv2wBqBF 3r6y8oUfRUnNLvbFkBasxnTQPQ== X-Received: by 2002:aa7:8e9e:0:b0:56b:bbca:dd98 with SMTP id a30-20020aa78e9e000000b0056bbbcadd98mr36470984pfr.7.1667575098495; Fri, 04 Nov 2022 08:18:18 -0700 (PDT) Received: from [192.168.0.168] ([103.99.10.63]) by smtp.gmail.com with ESMTPSA id i5-20020a056a00004500b0056a93838606sm2868901pfk.58.2022.11.04.08.18.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Nov 2022 08:18:17 -0700 (PDT) Message-ID: Date: Fri, 4 Nov 2022 09:18:13 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH 1/2] usb/usbip: fix uninitialized variables errors To: Greg KH Cc: shuah@kernel.org, valentina.manea.m@gmail.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <76654f2f1cc30b27be10ac9b177bb449a7ad7068.1667480280.git.skhan@linuxfoundation.org> Content-Language: en-US From: Shuah Khan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 11/3/22 07:21, Greg KH wrote: > 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. > You are right that this one is a false positive. I will take a close look at the others in this patch. thanks, -- Shuah