Patch "net: ethtool: fix the error condition in ethtool_get_phy_stats_ethtool()" has been added to the 6.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: ethtool: fix the error condition in ethtool_get_phy_stats_ethtool()

to the 6.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-ethtool-fix-the-error-condition-in-ethtool_get_p.patch
and it can be found in the queue-6.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f92f6f19c890a216c57262bfcb522089b85ddd4e
Author: Su Hui <suhui@xxxxxxxxxxxx>
Date:   Wed Jun 5 11:47:43 2024 +0800

    net: ethtool: fix the error condition in ethtool_get_phy_stats_ethtool()
    
    [ Upstream commit 0dcc53abf58d572d34c5313de85f607cd33fc691 ]
    
    Clang static checker (scan-build) warning:
    net/ethtool/ioctl.c:line 2233, column 2
    Called function pointer is null (null dereference).
    
    Return '-EOPNOTSUPP' when 'ops->get_ethtool_phy_stats' is NULL to fix
    this typo error.
    
    Fixes: 201ed315f967 ("net/ethtool/ioctl: split ethtool_get_phy_stats into multiple helpers")
    Signed-off-by: Su Hui <suhui@xxxxxxxxxxxx>
    Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@xxxxxxxxx>
    Reviewed-by: Hariprasad Kelam <hkelam@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240605034742.921751-1-suhui@xxxxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index 5a55270aa86e8..e645d751a5e89 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -2220,7 +2220,7 @@ static int ethtool_get_phy_stats_ethtool(struct net_device *dev,
 	const struct ethtool_ops *ops = dev->ethtool_ops;
 	int n_stats, ret;
 
-	if (!ops || !ops->get_sset_count || ops->get_ethtool_phy_stats)
+	if (!ops || !ops->get_sset_count || !ops->get_ethtool_phy_stats)
 		return -EOPNOTSUPP;
 
 	n_stats = ops->get_sset_count(dev, ETH_SS_PHY_STATS);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux