Merge tag 'rtc-4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni...
[linux-2.6-microblaze.git] / drivers / net / usb / asix_common.c
index f4d7362..e95dd12 100644 (file)
@@ -640,8 +640,8 @@ int asix_get_eeprom(struct net_device *net, struct ethtool_eeprom *eeprom,
        first_word = eeprom->offset >> 1;
        last_word = (eeprom->offset + eeprom->len - 1) >> 1;
 
-       eeprom_buff = kmalloc(sizeof(u16) * (last_word - first_word + 1),
-                             GFP_KERNEL);
+       eeprom_buff = kmalloc_array(last_word - first_word + 1, sizeof(u16),
+                                   GFP_KERNEL);
        if (!eeprom_buff)
                return -ENOMEM;
 
@@ -680,8 +680,8 @@ int asix_set_eeprom(struct net_device *net, struct ethtool_eeprom *eeprom,
        first_word = eeprom->offset >> 1;
        last_word = (eeprom->offset + eeprom->len - 1) >> 1;
 
-       eeprom_buff = kmalloc(sizeof(u16) * (last_word - first_word + 1),
-                             GFP_KERNEL);
+       eeprom_buff = kmalloc_array(last_word - first_word + 1, sizeof(u16),
+                                   GFP_KERNEL);
        if (!eeprom_buff)
                return -ENOMEM;