Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2041670rbb; Tue, 27 Feb 2024 08:53:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWHdpl4Nk+eWdidqsmnIvSgdirnrhH5yJuQyempCbTsyWzld2WkNEzA1voyqvezYhFh9VLeUcEU1Txy/WnabNJhiA6DoPSLAi9+fAx/iA== X-Google-Smtp-Source: AGHT+IEKqoodGrNcuCkeR2NA2XxnKDLMEto+hoy9kMerPYvL2drI3MuceYe1AfMjUl2lk0K1G8Sn X-Received: by 2002:a17:903:2345:b0:1dc:7890:cb27 with SMTP id c5-20020a170903234500b001dc7890cb27mr12424110plh.48.1709052823260; Tue, 27 Feb 2024 08:53:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709052823; cv=pass; d=google.com; s=arc-20160816; b=C5+Jh/R8vVt3obEUtzf9oIFX/rIo7D7Kao2sBY/PctyPsEQ/NlbuP2ys/HDT5OSuYj 2i3sJwLIOwO+PO2mLEZK0ECy7srdG6lAkDcmTml8kJAUvYqBQ1jL8kXUwDJdgXkiDYtn X2neg6HpaS07aUy2oX1cJhdg7AAnkXhl9LP828prJyI7tRIAENnFPZKiFEfRkCnMyOAT yErbDcDokQ8TnGBmuBkAtNjO//zgPKTtORP7p8RsSZqeu4wzdxJIKyKzXw0sKOVgNBD2 rg3pZh1mwrHYtDxiPCwKxb+Fd+/1E1JpQj82H6VArqEHTc9cNlFTqvXUtz9hBiqhaOwt d9Wg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from; bh=eKEVEdmkMyiSc5YLtBbkSgkl+BzuGIKvDcOUBSgg/GE=; fh=dOLGEHru4IqSw9XsbAvCvRLUmtje5n7/O0Un4cy1Ivw=; b=Ckj3Q7fF1gBJMxFTtpuOEOhwneRPLMe4dbmrLWftXp7HKrfYKGUw5syinY8IRGAQvm ItGKxeH464JINGUeZLBLJO9Myji3cH2/w7ewrvcyBLsLeyb63VrqxZINpfM2N0vFINPe Px5Eeclt0nu3xuTFuw1NWl2Z653BNmCQhGkUzIxtVhWZSwV6c90M1eEJ75giqugQ+JEu OSMEWOGxdnjqs+UKfAFLi/ttAPbrghx5wGwdsgFx/+7mMzhbEzwmBhh0iyfkGvNg8VBC QyOAyeWMXPGuaGOARIIf4HKe+xayXkSNe3E8fMbWF0P3is5RAfOt4OaFumMG72aRfdkN psHg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=korsgaard.com); spf=pass (google.com: domain of linux-kernel+bounces-83655-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83655-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p10-20020a170902780a00b001dba7e06c0dsi1594076pll.127.2024.02.27.08.53.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 08:53:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83655-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=korsgaard.com); spf=pass (google.com: domain of linux-kernel+bounces-83655-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83655-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F11CF283885 for ; Tue, 27 Feb 2024 16:53:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5B9F3E480; Tue, 27 Feb 2024 16:53:29 +0000 (UTC) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 DCF88219ED; Tue, 27 Feb 2024 16:53:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709052809; cv=none; b=KVBJfYxIwAmrekBZXbtx+sHJC99nkWLsENPRIoSnQ1Km/I9rnQiAr6DQ8Q/xIqHgqxazBMU7EZ06wBZ+plzkGwVlITqMCDJY22XnP6cYRZLFbOR3ihw45gKavJcYwqMkxmm7BbFghe+JU/9aRxVgqeUEMLKC/jbL15z6wxxNW/w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709052809; c=relaxed/simple; bh=+gMJzooNARvw2e0xhnqYaNuQPV+f/gPimN+Y24GZ6GU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=Mq5P7n4eKURf931cfjJiKZyPp03IsjWH8e+/82d16HZboJ2N6qrSmQaJRJfB6WnV81B2uZkDayrxubtIrqXQ15JYsfkdt4b/2YjBv8nrNAv/qoBcHx2gZx5WE0O28Np1NNTpkpN1LkA+e8C9N33UM0gVJzy+mccddCNdSCBsLvk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=korsgaard.com; spf=pass smtp.mailfrom=korsgaard.com; arc=none smtp.client-ip=217.70.183.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=korsgaard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=korsgaard.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 24EE924000C; Tue, 27 Feb 2024 16:53:22 +0000 (UTC) Received: from peko by dell.be.48ers.dk with local (Exim 4.96) (envelope-from ) id 1rf0hm-00GAei-0Z; Tue, 27 Feb 2024 17:53:22 +0100 From: Peter Korsgaard To: Javier Carrasco Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: usb: dm9601: fix wrong return value in dm9601_mdio_read References: <20240225-dm9601_ret_err-v1-1-02c1d959ea59@gmail.com> Date: Tue, 27 Feb 2024 17:53:22 +0100 In-Reply-To: <20240225-dm9601_ret_err-v1-1-02c1d959ea59@gmail.com> (Javier Carrasco's message of "Sun, 25 Feb 2024 00:20:06 +0100") Message-ID: <874jdtsvb1.fsf@48ers.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: peter@korsgaard.com >>>>> "Javier" == Javier Carrasco writes: > The MII code does not check the return value of mdio_read (among > others), and therefore no error code should be sent. A previous fix to > the use of an uninitialized variable propagates negative error codes, > that might lead to wrong operations by the MII library. > An example of such issues is the use of mii_nway_restart by the dm9601 > driver. The mii_nway_restart function does not check the value returned > by mdio_read, which in this case might be a negative number which could > contain the exact bit the function checks (BMCR_ANENABLE = 0x1000). > Return zero in case of error, as it is common practice in users of > mdio_read to avoid wrong uses of the return value. > Fixes: 8f8abb863fa5 ("net: usb: dm9601: fix uninitialized variable use in dm9601_mdio_read") > Signed-off-by: Javier Carrasco Reviewed-by: Peter Korsgaard -- Bye, Peter Korsgaard