mirror of https://gitee.com/openkylin/linux.git
pch_phub: Report error writing MAC back to user
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
35272754e2
commit
a246b97358
|
@ -636,6 +636,7 @@ static ssize_t store_pch_mac(struct device *dev, struct device_attribute *attr,
|
||||||
u8 mac[ETH_ALEN];
|
u8 mac[ETH_ALEN];
|
||||||
ssize_t rom_size;
|
ssize_t rom_size;
|
||||||
struct pch_phub_reg *chip = dev_get_drvdata(dev);
|
struct pch_phub_reg *chip = dev_get_drvdata(dev);
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (!mac_pton(buf, mac))
|
if (!mac_pton(buf, mac))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -644,8 +645,10 @@ static ssize_t store_pch_mac(struct device *dev, struct device_attribute *attr,
|
||||||
if (!chip->pch_phub_extrom_base_address)
|
if (!chip->pch_phub_extrom_base_address)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
pch_phub_write_gbe_mac_addr(chip, mac);
|
ret = pch_phub_write_gbe_mac_addr(chip, mac);
|
||||||
pci_unmap_rom(chip->pdev, chip->pch_phub_extrom_base_address);
|
pci_unmap_rom(chip->pdev, chip->pch_phub_extrom_base_address);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue