Merge "drm/msm: gracefully handle NULL return from setup_pagetable()"
This commit is contained in:
commit
8b2a2a4d4f
4 changed files with 11 additions and 3 deletions
|
@ -602,7 +602,8 @@ static int msm_open(struct drm_device *dev, struct drm_file *file)
|
|||
if (IS_ERR(ctx))
|
||||
return PTR_ERR(ctx);
|
||||
|
||||
INIT_LIST_HEAD(&ctx->counters);
|
||||
if (ctx)
|
||||
INIT_LIST_HEAD(&ctx->counters);
|
||||
|
||||
msm_submitqueue_init(ctx);
|
||||
|
||||
|
|
|
@ -1046,7 +1046,7 @@ struct drm_gem_object *msm_gem_svm_new(struct drm_device *dev,
|
|||
{
|
||||
struct drm_gem_object *obj;
|
||||
struct msm_file_private *ctx = file->driver_priv;
|
||||
struct msm_gem_address_space *aspace = ctx->aspace;
|
||||
struct msm_gem_address_space *aspace;
|
||||
struct msm_gem_object *msm_obj;
|
||||
struct msm_gem_svm_object *msm_svm_obj;
|
||||
struct msm_gem_vma *domain = NULL;
|
||||
|
@ -1056,6 +1056,9 @@ struct drm_gem_object *msm_gem_svm_new(struct drm_device *dev,
|
|||
int write;
|
||||
int ret;
|
||||
|
||||
if (!ctx)
|
||||
return ERR_PTR(-ENODEV);
|
||||
|
||||
/* if we don't have IOMMU, don't bother pretending we can import: */
|
||||
if (!iommu_present(&platform_bus_type)) {
|
||||
dev_err_once(dev->dev, "cannot import without IOMMU\n");
|
||||
|
@ -1078,6 +1081,7 @@ struct drm_gem_object *msm_gem_svm_new(struct drm_device *dev,
|
|||
drm_gem_private_object_init(dev, obj, size);
|
||||
|
||||
msm_obj = to_msm_bo(obj);
|
||||
aspace = ctx->aspace;
|
||||
domain = obj_add_domain(&msm_obj->base, aspace);
|
||||
if (IS_ERR(domain)) {
|
||||
drm_gem_object_unreference_unlocked(obj);
|
||||
|
|
|
@ -430,7 +430,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
|
|||
return -EINVAL;
|
||||
|
||||
gpu = priv->gpu;
|
||||
if (!gpu)
|
||||
if (!gpu || !ctx)
|
||||
return -ENXIO;
|
||||
|
||||
queue = msm_submitqueue_get(ctx, args->queueid);
|
||||
|
|
|
@ -669,6 +669,9 @@ int msm_gpu_counter_put(struct msm_gpu *gpu, struct drm_msm_counter *data,
|
|||
{
|
||||
struct msm_context_counter *entry;
|
||||
|
||||
if (!gpu || !ctx)
|
||||
return -ENODEV;
|
||||
|
||||
list_for_each_entry(entry, &ctx->counters, node) {
|
||||
if (entry->groupid == data->groupid &&
|
||||
entry->counterid == data->counterid) {
|
||||
|
|
Loading…
Add table
Reference in a new issue