treewide: kmalloc() -> kmalloc_array()
[linux-block.git] / sound / pci / hda / hda_codec.c
index 08151f3c0b139703fcd175cc5c255f66f89755ca..d91c87e41756ea5fceaee73d84e211b9ebba929d 100644 (file)
@@ -158,7 +158,7 @@ static int read_and_add_raw_conns(struct hda_codec *codec, hda_nid_t nid)
        len = snd_hda_get_raw_connections(codec, nid, list, ARRAY_SIZE(list));
        if (len == -ENOSPC) {
                len = snd_hda_get_num_raw_conns(codec, nid);
-               result = kmalloc(sizeof(hda_nid_t) * len, GFP_KERNEL);
+               result = kmalloc_array(len, sizeof(hda_nid_t), GFP_KERNEL);
                if (!result)
                        return -ENOMEM;
                len = snd_hda_get_raw_connections(codec, nid, result, len);
@@ -438,7 +438,7 @@ static int read_widget_caps(struct hda_codec *codec, hda_nid_t fg_node)
        int i;
        hda_nid_t nid;
 
-       codec->wcaps = kmalloc(codec->core.num_nodes * 4, GFP_KERNEL);
+       codec->wcaps = kmalloc_array(codec->core.num_nodes, 4, GFP_KERNEL);
        if (!codec->wcaps)
                return -ENOMEM;
        nid = codec->core.start_nid;