Patch "net: sparx5: Fix reading of the MAC address" has been added to the 6.0-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: sparx5: Fix reading of the MAC address

to the 6.0-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-sparx5-fix-reading-of-the-mac-address.patch
and it can be found in the queue-6.0 subdirectory.

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



commit 9e02031a2820181c0b5334244b725d931f7558ef
Author: Horatiu Vultur <horatiu.vultur@xxxxxxxxxxxxx>
Date:   Mon Jan 2 13:12:15 2023 +0100

    net: sparx5: Fix reading of the MAC address
    
    [ Upstream commit 588ab2dc25f60efeb516b4abedb6c551949cc185 ]
    
    There is an issue with the checking of the return value of
    'of_get_mac_address', which returns 0 on success and negative value on
    failure. The driver interpretated the result the opposite way. Therefore
    if there was a MAC address defined in the DT, then the driver was
    generating a random MAC address otherwise it would use address 0.
    Fix this by checking correctly the return value of 'of_get_mac_address'
    
    Fixes: b74ef9f9cb91 ("net: sparx5: Do not use mac_addr uninitialized in mchp_sparx5_probe()")
    Signed-off-by: Horatiu Vultur <horatiu.vultur@xxxxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
index e58de119186a..a2d0631f7ac7 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
@@ -819,7 +819,7 @@ static int mchp_sparx5_probe(struct platform_device *pdev)
 	if (err)
 		goto cleanup_config;
 
-	if (!of_get_mac_address(np, sparx5->base_mac)) {
+	if (of_get_mac_address(np, sparx5->base_mac)) {
 		dev_info(sparx5->dev, "MAC addr was not set, use random MAC\n");
 		eth_random_addr(sparx5->base_mac);
 		sparx5->base_mac[5] = 0;



[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