treewide: kzalloc() -> kcalloc()
[linux-2.6-block.git] / drivers / scsi / st.c
index a427ce9497be9dc9b418dd55a80849cd958c2d47..50c66ccc4b41eaa836ea08d5dfdda2c9206545e2 100644 (file)
@@ -3878,7 +3878,7 @@ static struct st_buffer *new_tape_buffer(int need_dma, int max_sg)
 {
        struct st_buffer *tb;
 
-       tb = kzalloc(sizeof(struct st_buffer), GFP_ATOMIC);
+       tb = kzalloc(sizeof(struct st_buffer), GFP_KERNEL);
        if (!tb) {
                printk(KERN_NOTICE "st: Can't allocate new tape buffer.\n");
                return NULL;
@@ -3888,8 +3888,8 @@ 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 *),
-                                    GFP_ATOMIC);
+       tb->reserved_pages = kcalloc(max_sg, sizeof(struct page *),
+                                    GFP_KERNEL);
        if (!tb->reserved_pages) {
                kfree(tb);
                return NULL;
@@ -4290,7 +4290,7 @@ static int st_probe(struct device *dev)
                goto out_buffer_free;
        }
 
-       tpnt = kzalloc(sizeof(struct scsi_tape), GFP_ATOMIC);
+       tpnt = kzalloc(sizeof(struct scsi_tape), GFP_KERNEL);
        if (tpnt == NULL) {
                sdev_printk(KERN_ERR, SDp,
                            "st: Can't allocate device descriptor.\n");
@@ -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 */