treewide: Use array_size() in vmalloc()
[linux-2.6-block.git] / drivers / net / ppp / bsd_comp.c
index a9b759add187ad3033849c402b4854f2dfb2b074..61fedb23d3cfa72ccba6fbdcdff0f8de40786ce7 100644 (file)
@@ -406,7 +406,7 @@ static void *bsd_alloc (unsigned char *options, int opt_len, int decomp)
  * Allocate space for the dictionary. This may be more than one page in
  * length.
  */
-    db->dict = vmalloc(hsize * sizeof(struct bsd_dict));
+    db->dict = vmalloc(array_size(hsize, sizeof(struct bsd_dict)));
     if (!db->dict)
       {
        bsd_free (db);
@@ -425,7 +425,7 @@ static void *bsd_alloc (unsigned char *options, int opt_len, int decomp)
  */
     else
       {
-        db->lens = vmalloc((maxmaxcode + 1) * sizeof(db->lens[0]));
+        db->lens = vmalloc(array_size(sizeof(db->lens[0]), (maxmaxcode + 1)));
        if (!db->lens)
          {
            bsd_free (db);