]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/gpu/host1x/job.c
gpu: host1x: returning success instead of -ENOMEM
[karo-tx-linux.git] / drivers / gpu / host1x / job.c
index cc807667d8f16c2f4ac345f28c1965a89e911ee8..c4e1050f2252679e448e58e1c2b3edffffd08073 100644 (file)
@@ -42,12 +42,12 @@ struct host1x_job *host1x_job_alloc(struct host1x_channel *ch,
 
        /* Check that we're not going to overflow */
        total = sizeof(struct host1x_job) +
-               num_relocs * sizeof(struct host1x_reloc) +
-               num_unpins * sizeof(struct host1x_job_unpin_data) +
-               num_waitchks * sizeof(struct host1x_waitchk) +
-               num_cmdbufs * sizeof(struct host1x_job_gather) +
-               num_unpins * sizeof(dma_addr_t) +
-               num_unpins * sizeof(u32 *);
+               (u64)num_relocs * sizeof(struct host1x_reloc) +
+               (u64)num_unpins * sizeof(struct host1x_job_unpin_data) +
+               (u64)num_waitchks * sizeof(struct host1x_waitchk) +
+               (u64)num_cmdbufs * sizeof(struct host1x_job_gather) +
+               (u64)num_unpins * sizeof(dma_addr_t) +
+               (u64)num_unpins * sizeof(u32 *);
        if (total > ULONG_MAX)
                return NULL;
 
@@ -466,9 +466,8 @@ static inline int copy_gathers(struct host1x_job *job, struct device *dev)
                                                         &job->gather_copy,
                                                         GFP_KERNEL);
        if (!job->gather_copy_mapped) {
-               int err = PTR_ERR(job->gather_copy_mapped);
                job->gather_copy_mapped = NULL;
-               return err;
+               return -ENOMEM;
        }
 
        job->gather_copy_size = size;