Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28689475rwd; Wed, 5 Jul 2023 00:54:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlEPgbrJxhnPFkfXPMnZNvuwbJwE4d+9vnDMwxe8DZTfkQ1xVxN9/Gl3cyjEi7+A9Bsl2n6+ X-Received: by 2002:a17:90a:19ca:b0:25e:f6bf:badb with SMTP id 10-20020a17090a19ca00b0025ef6bfbadbmr15259869pjj.4.1688543667780; Wed, 05 Jul 2023 00:54:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688543667; cv=none; d=google.com; s=arc-20160816; b=jorwMYD/QNo+KH2ECpM1Q3xigZAMdCFyRmWJVBJofw+TfKIDvhGIC32Yph+TGnNI17 y6EfyZgk6sJDEvlGbtioFh2jG6IF/S8TMR5s5X64tl0jsVOSbkg/iM4Jdoy9DsH/tuNH IvtkIibXBcqOpXjefcPOCN0eKY7tBkvabouYOztR9kugCvZ4we9v2YED/BLcekly2ybb zTRZyyGm55s8vK/e7dEOr211aWoewm8w4uVqImBEyqiX4GJMBcrrxxhf1VqUsCZUUQ3S cZ97x6MhNvau8ZrxfgsgvnYU54aZiI57meJMtnKNMobX7C8BVIgl9iBeAQ6e3huYPXLv kxMw== 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=EooX7/UP0QEGZxAPySw4wAI931CvRqCcdOm5e8XZm4w=; fh=qlTpmJZcQ0PjaXjkvqQraDvVHneygnwWFVqjx950Dp0=; b=qnkAj0W7PXEdQxJ1o148+e+3fyAQv6oc5I5elcvT9NsT1T3rSxxQBcW/iStj98ZxqC iPzwoakMpRGH78Puo6rUIljoWJFw5IIGmYR8ckk2liSLp7gSTpiamlfwbrJRgWfh9I6c POZC4NT3qieyRPvrV96rrBzrq5cWgoEWwvSEmO0meIfMS13AYNZ2mtPK9+PTLcof5gy0 2dT9/R6wSYzXYY8Vc0hRsaxHAlG7GztI/McY42kRvYEmLiuPaRRuhKhXvOHq4NgkwcS1 e2eRP+Q3zX+hUNu1jqKismgSTNXnC44jX06OVRs9GiFoIAbUzqwjHW3fTNwlqXlQdHI4 LZjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vH+XQSRQ; 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 w8-20020a17090a8a0800b00262c146b8cesi1147167pjn.158.2023.07.05.00.54.12; Wed, 05 Jul 2023 00:54:27 -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=vH+XQSRQ; 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 S232195AbjGEHQn (ORCPT + 99 others); Wed, 5 Jul 2023 03:16:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231296AbjGEHQl (ORCPT ); Wed, 5 Jul 2023 03:16:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28BC51AD; Wed, 5 Jul 2023 00:16:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A7CEA61457; Wed, 5 Jul 2023 07:16:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCF19C433C7; Wed, 5 Jul 2023 07:16:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1688541399; bh=rgJSmdWf7HZndKl2mOS2c4ZW2ja00reA75bqebA5N5w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vH+XQSRQRzQ2GruZofvDvB4wgPWzbq6KDZ60x9IF+TdMAc72KsVQMSdd/J5vlrpLb koKIOuYzR3rCPYvAXnswBrN17pKIOo03fken9BO2EQ/JvLf4X0gRgXQVUSB7GLsU53 3ZAZ2uRbwy1sF6S2nG20gedZB0BY9j9JWT2/hYko= Date: Wed, 5 Jul 2023 08:16:37 +0100 From: Greg KH To: Yu Hao Cc: woojung.huh@microchip.com, UNGLinuxDriver@microchip.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel Subject: Re: [PATCH] net: lan78xx: Fix possible uninit bug Message-ID: <2023070522-stubbly-monthly-3fb1@gregkh> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Tue, Jul 04, 2023 at 06:15:09PM -0700, Yu Hao wrote: > The variable buf should be initialized in the function lan78xx_read_reg. > However, there is no return value check, which means the variable buf > could still be uninit. But there is a read later. > > Signed-off-by: Yu Hao > --- > drivers/net/usb/lan78xx.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c > index c458c030fadf..4c9318c92fe6 100644 > --- a/drivers/net/usb/lan78xx.c > +++ b/drivers/net/usb/lan78xx.c > @@ -1091,8 +1091,11 @@ static int lan78xx_write_raw_otp(struct > lan78xx_net *dev, u32 offset, > int i; > u32 buf; > unsigned long timeout; > + int ret; > > - lan78xx_read_reg(dev, OTP_PWR_DN, &buf); > + ret = lan78xx_read_reg(dev, OTP_PWR_DN, &buf); > + if (ret < 0) > + return ret; > > if (buf & OTP_PWR_DN_PWRDN_N_) { > /* clear it and wait to be cleared */ > -- > 2.34.1 Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - Your patch is malformed (tabs converted to spaces, linewrapped, etc.) and can not be applied. Please read the file, Documentation/process/email-clients.rst in order to fix this. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot