From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 4E69D372054; Mon, 25 May 2026 18:49:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779734953; cv=none; b=usvXwlSkXrkL4TiNuEy65VVKp6HBsu2NR1e88OoL57QQ+zaCsJ4AHMMTDoAZtWjiL5jBIHaNw88m00Jlvp3/fXK6dwoVleMSd75T7KhJnLEEt7qptDzKWAh812K2t7xc9sOFvqdUyy6+6JcHYrxZU6HM4VCY11h2v9D2IGGfWqA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779734953; c=relaxed/simple; bh=H72zRI8cP/KffugqxL7L36mJRek0Vxk/13r9uYCI66o=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qzlPIaW+l/S7Q7rNgn3AmrOaIUsEE0xscNHAytHjVZX0h7LofbTu2MERM/3tBEzzMlpyUsrzN4yBZEdqoCjDXo7hsE36lrv8jA0fu59W4/nBFe0B9MmO+EJD4LOkwtSHa4DdDYDts8BQ9nqEtNXqEF9lrOTcJ2i7XcMctBPR5GE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Udn7zL8H; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Udn7zL8H" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 863251F000E9; Mon, 25 May 2026 18:49:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779734951; bh=gayMRpTAXCPOoFKUyUtLNpFZ8RKzjHieHL0byLqgm6E=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=Udn7zL8Htl476+mo5A7cVaYMhE+iaRkAb14xIaxb6930Af2EnBLlq4FmuMGkMNqSN Twn1s4xV9buYw+lE+/OfIs1whhSWBRZ7b2J16oK8KZgGcvsFnktitRAejQz7fySlOf G+e7Piwy7pmy1L/FoVzNg35cNTbjtWSmLHZL1PtfexkCk3krlewoS/Q7tzgIAeCJYw JdUGX5jIXvZaY51NaRfIU1DkecSJ0eijhe5Okk50SWDOp1AY51rCdwLBX4yIBp1jL8 3W/TWc6NxEu1kjvAvqPKMVhsgpqg8hgYV4T4yIIeK2OL/QCRWWxb6hgcHruy9Fw9GQ P+Y36pZlWuwZQ== Date: Mon, 25 May 2026 11:49:10 -0700 From: Jakub Kicinski To: Li Wang Cc: "Michael S . Tsirkin" , Jason Wang , Xuan Zhuo , Eugenio =?UTF-8?B?UMOpcmV6?= , netdev@vger.kernel.org, virtualization@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] virtio_net: drop redundant err assignment in virtnet_probe() Message-ID: <20260525114910.47806c7b@kernel.org> In-Reply-To: <20260520102309.281616-1-liwang@kylinos.cn> References: <20260520102309.281616-1-liwang@kylinos.cn> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 20 May 2026 18:23:09 +0800 Li Wang wrote: > err is initialized to -ENOMEM at the start of virtnet_probe(), and no > code path between that and the devm_kzalloc() failure can change > err. Assigning -ENOMEM again before goto free therefore is redundant. This is asking for a bug, someone may add code before this if () overriding err to 0. They are 130 lines apart! If you want to removing something remove the inline init at the start of the function. But FTR I think that'd also be pointless churn.