ASoC: meson: add tdm input driver
[linux-2.6-block.git] / drivers / scsi / st.c
index c9e27e752c2545dff1a3714ce5817f7e3036e07b..50c66ccc4b41eaa836ea08d5dfdda2c9206545e2 100644 (file)
@@ -3888,7 +3888,7 @@ static struct st_buffer *new_tape_buffer(int need_dma, int max_sg)
        tb->dma = need_dma;
        tb->buffer_size = 0;
 
-       tb->reserved_pages = kzalloc(max_sg * sizeof(struct page *),
+       tb->reserved_pages = kcalloc(max_sg, sizeof(struct page *),
                                     GFP_KERNEL);
        if (!tb->reserved_pages) {
                kfree(tb);
@@ -4915,7 +4915,8 @@ static int sgl_map_user_pages(struct st_buffer *STbp,
        if (count == 0)
                return 0;
 
-       if ((pages = kmalloc(max_pages * sizeof(*pages), GFP_KERNEL)) == NULL)
+       pages = kmalloc_array(max_pages, sizeof(*pages), GFP_KERNEL);
+       if (pages == NULL)
                return -ENOMEM;
 
         /* Try to fault in all of the necessary pages */