From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (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 646102DFA4A; Sun, 5 Apr 2026 23:38:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775432306; cv=none; b=JRi3K65ufYsvI6KXPTXV9TIKMBNqYWvEEA0MNNXSbb2NjV1tMGUIVhLZk1/T+I4Srs5NK0L1xg+IZ4aq6dn+ISgIqujiYkbGQ8Hc6GFB6kz0FdQ9rv+ntLKRotzmkkZuQIdXwbB/Hc+zABhX+hQB7opvNREDG9Y+fVDsmlAPG2M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775432306; c=relaxed/simple; bh=BlF4hdRKoQTwwkgj3MRbFI0zcGVQlP3zCR6cUM5//n4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GZzQ1MttbViw91cmdiaSGZKVQY4bkwx+vNx8wqns/hfn5Rr18fWH4Z+dAPAV5chwyaMkI3G2M5FZq1P2wgRXbCY/G9sIKmaJ4oOxBd+fDB4+scN2BylzwNHa5qdgzvgHUdBb0wruovNoD26MD9MhNO4ZONkpP1VFpqAIn57fZJ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=kdx2TwJA; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="kdx2TwJA" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=frr/vyDVrkNBFv1uvWKDe7YbXUlbwouqZpZ2NnxuGxc=; b=kdx2TwJAf2hL4jzsomRnef0xpr lMlVc2vd45dVY47asp8gIONMWD76CnOSlVpnm6lOuaH9v34VYPQnEB9qLaYlUZBVmPpOqpEhjPP01 NPzo7ocBS+lrohHL1vJSL2FGqZOPcx47DLMasrKNVGxterpBzpNbDN3jjXyzwjw9BqQU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1w9X2c-00Evj1-1S; Mon, 06 Apr 2026 01:38:06 +0200 Date: Mon, 6 Apr 2026 01:38:06 +0200 From: Andrew Lunn To: Petko Manolov Cc: Simon Horman , Morduan Zang , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+9db6c624635564ad813c@syzkaller.appspotmail.com Subject: Re: [PATCH] usb: rtl8150: avoid using uninitialized CSCR value Message-ID: <76d6b341-27d5-44aa-92fb-3b8966d609df@lunn.ch> References: <93FF85BB9F33CD2B+20260402070743.20641-1-zhangdandan@uniontech.com> <20260403154538.GA187715@horms.kernel.org> <20260405085212.GA8491@cabron.k.g> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260405085212.GA8491@cabron.k.g> > > - get_registers(dev, CSCR, 2, &tmp); > > + if (get_registers(dev, CSCR, 2, &tmp) < 0) > > + tmp = 0; > > if (tmp & CSCR_LINK_STATUS) > > netif_carrier_on(netdev); > > else > > I was wondering if calling netif_carrier_off() is the right thing to do in case > get_registers() fail. > > There are multiple get_registers() calls that don't check the error and if we do > this in set_carrier() maybe we should do the same thing across the whole driver? What does it actually mean if get_registers() fails? The device is gone? Hot unplugged? If so, you are going to get a cascade of errors, and then hopefully the USB core code removes the device? Are there any legitimate reasons for get_registers() to fail if the device is still plugged in? It seems netif_carrier_off() is unnecessary? Andrew