From patchwork Wed Jun 19 13:28:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Neukum X-Patchwork-Id: 13703830 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5276A14373E; Wed, 19 Jun 2024 13:28:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718803704; cv=none; b=TCOTIDAoMvp8CfAjO6JNhhYgZkB0xeu1jAxF7ny20FEuPChYEQMmJUsc2+SpUsOSRUhS0ymQhg7NB8P85zFBYJmxhNX7fufL1rp0wyhwaMcW13HLmZmlrfmU5Jfk0dxiy/ZSEBj2JGKk9giMa2OqdajAeIHSXK0n58Qdrxntcoo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718803704; c=relaxed/simple; bh=23ifTE2BbLszVOYk+nDmzGkUuLpyFuSdy9xfyKOZ0kM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KWn3OP656yBiKcMRPD9XncQ8Tul6tKHyzV9Dm4q4rX6UVV/XTy7M4wdU6x8E7unG05lSUL6fI88iD+F+gGNrpV9MXzqzMJ805uYMth38++s9sHyUm7W1ggkp8hgQtfa5O65z5fabP+8SCt1rf1nrYjS8dHIRhcK6JFW93d8oA5E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=a2Zw825w; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=a2Zw825w; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="a2Zw825w"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="a2Zw825w" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 4FE9821AB5; Wed, 19 Jun 2024 13:28:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1718803700; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=4JsY+EPtMaRXfnzJxvSEnU0R09HA9SC8CtDxtOIu5Dg=; b=a2Zw825wwynfuNcrk2V0Q4dBCa1m8mr0kGF06U6s72kCaNa5CyA5IVW9NeYl1rbq/sIjvV LN7knV0tstiTjhQZ1wV8VRMduQwEjbMMTvw+xvp6zLBVnLdDnYbx1jIOljdByYw+CvSrcn Blzo8qwN3VlUML6AlfI2R3mMAajBAYE= Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=a2Zw825w DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1718803700; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=4JsY+EPtMaRXfnzJxvSEnU0R09HA9SC8CtDxtOIu5Dg=; b=a2Zw825wwynfuNcrk2V0Q4dBCa1m8mr0kGF06U6s72kCaNa5CyA5IVW9NeYl1rbq/sIjvV LN7knV0tstiTjhQZ1wV8VRMduQwEjbMMTvw+xvp6zLBVnLdDnYbx1jIOljdByYw+CvSrcn Blzo8qwN3VlUML6AlfI2R3mMAajBAYE= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D75CE13ABD; Wed, 19 Jun 2024 13:28:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 98Q2MvPccmZ4egAAD6G6ig (envelope-from ); Wed, 19 Jun 2024 13:28:19 +0000 From: Oliver Neukum To: petkan@nucleusys.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Oliver Neukum , syzbot+5186630949e3c55f0799@syzkaller.appspotmail.com Subject: [PATCH net] net: usb: rtl8150 fix unintiatilzed variables in rtl8150_get_link_ksettings Date: Wed, 19 Jun 2024 15:28:03 +0200 Message-ID: <20240619132816.11526-1-oneukum@suse.com> X-Mailer: git-send-email 2.45.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spamd-Result: default: False [-0.49 / 50.00]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; DWL_DNSWL_LOW(-1.00)[suse.com:dkim]; MID_CONTAINS_FROM(1.00)[]; BAYES_HAM(-0.98)[86.98%]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_BLOCKED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.com:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from,2a07:de40:b281:106:10:150:64:167:received]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_SEVEN(0.00)[10]; RCVD_VIA_SMTP_AUTH(0.00)[]; TAGGED_RCPT(0.00)[5186630949e3c55f0799]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.com:dkim,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns] X-Spamd-Bar: / X-Rspamd-Queue-Id: 4FE9821AB5 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spam-Flag: NO X-Spam-Score: -0.49 X-Spam-Level: X-Patchwork-Delegate: kuba@kernel.org This functions retrieves values by passing a pointer. As the function that retrieves them can fail before touching the pointers, the variables must be initialized. Reported-by: syzbot+5186630949e3c55f0799@syzkaller.appspotmail.com Signed-off-by: Oliver Neukum --- drivers/net/usb/rtl8150.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c index 97afd7335d86..01a3b2417a54 100644 --- a/drivers/net/usb/rtl8150.c +++ b/drivers/net/usb/rtl8150.c @@ -778,7 +778,8 @@ static int rtl8150_get_link_ksettings(struct net_device *netdev, struct ethtool_link_ksettings *ecmd) { rtl8150_t *dev = netdev_priv(netdev); - short lpa, bmcr; + short lpa = 0; + short bmcr = 0; u32 supported; supported = (SUPPORTED_10baseT_Half |