Merge branch 'work.compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-2.6-microblaze.git] / drivers / scsi / osst.c
index 2bbe797..7a1a1ed 100644 (file)
@@ -381,7 +381,7 @@ static int osst_execute(struct osst_request *SRpnt, const unsigned char *cmd,
                struct scatterlist *sg, *sgl = (struct scatterlist *)buffer;
                int i;
 
-               pages = kzalloc(use_sg * sizeof(struct page *), GFP_KERNEL);
+               pages = kcalloc(use_sg, sizeof(struct page *), GFP_KERNEL);
                if (!pages)
                        goto free_req;
 
@@ -1488,7 +1488,7 @@ static int osst_read_back_buffer_and_rewrite(struct osst_tape * STp, struct osst
        int                     dbg              = debugging;
 #endif
 
-       if ((buffer = vmalloc((nframes + 1) * OS_DATA_SIZE)) == NULL)
+       if ((buffer = vmalloc(array_size((nframes + 1), OS_DATA_SIZE))) == NULL)
                return (-EIO);
 
        printk(KERN_INFO "%s:I: Reading back %d frames from drive buffer%s\n",
@@ -5856,7 +5856,9 @@ static int osst_probe(struct device *dev)
        /* if this is the first attach, build the infrastructure */
        write_lock(&os_scsi_tapes_lock);
        if (os_scsi_tapes == NULL) {
-               os_scsi_tapes = kmalloc(osst_max_dev * sizeof(struct osst_tape *), GFP_ATOMIC);
+               os_scsi_tapes = kmalloc_array(osst_max_dev,
+                                              sizeof(struct osst_tape *),
+                                              GFP_ATOMIC);
                if (os_scsi_tapes == NULL) {
                        write_unlock(&os_scsi_tapes_lock);
                        printk(KERN_ERR "osst :E: Unable to allocate array for OnStream SCSI tapes.\n");