]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: phy: at803x: Change error to EINVAL for invalid MAC
authorDan Murphy <dmurphy@ti.com>
Tue, 10 Oct 2017 17:42:56 +0000 (12:42 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Dec 2017 13:20:09 +0000 (14:20 +0100)
[ Upstream commit fc7556877d1748ac00958822a0a3bba1d4bd9e0d ]

Change the return error code to EINVAL if the MAC
address is not valid in the set_wol function.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/at803x.c

index fdc1b418fa6a82a434fa305c8785546bc6584ad9..5012708271ca9ae9bcbdb1c1997d45ae03ce8edc 100644 (file)
@@ -105,7 +105,7 @@ static int at803x_set_wol(struct phy_device *phydev,
                mac = (const u8 *) ndev->dev_addr;
 
                if (!is_valid_ether_addr(mac))
-                       return -EFAULT;
+                       return -EINVAL;
 
                for (i = 0; i < 3; i++) {
                        phy_write(phydev, AT803X_MMD_ACCESS_CONTROL,