Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b977e3a authored by Lingfeng Yang's avatar Lingfeng Yang
Browse files

ANDROID: Fix kernel build regressions from virtio-gpu-next patches



Fix the following:

drivers/gpu/drm/virtio/virtgpu_ioctl.c:587:8: warning: Variable 'buf' is
not assigned a value. [unassignedVariable]
drivers/gpu/drm/virtio/virtgpu_ioctl.c:624:9: warning: Local variable
'buf' shadows outer variable [shadowVariable]
drivers/gpu/drm/virtio/virtgpu_ioctl.c:678:50: warning: Either the
condition 'rc_blob->cmd_size&&vfpriv' is redundant or there is possible
null pointer dereference: vfpriv. [nullPointerRedundantCheck]
drivers/gpu/drm/virtio/virtgpu_ioctl.c:709:2: warning: 'buf' may be used
uninitialized in this function [-Wmaybe-uninitialized]
drivers/gpu/drm/virtio/virtgpu_kms.c:191:9: error: implicit declaration
of function 'pci_request_region'; did you mean 'pci_request_regions'?
[-Werror=implicit-function-declaration]

Bug: 155396530
Signed-off-by: default avatarLingfeng Yang <lfy@google.com>
Change-Id: I10f4172cfa520b4cd80c3c7ec31996f1b6f2c298
parent b564958e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
config DRM_VIRTIO_GPU
	tristate "Virtio GPU driver"
	depends on DRM && VIRTIO && MMU
	depends on DRM && VIRTIO && MMU && PCI
	select DRM_KMS_HELPER
	select DRM_TTM
	help
+2 −5
Original line number Diff line number Diff line
@@ -584,7 +584,6 @@ static int virtio_gpu_get_caps_ioctl(struct drm_device *dev,
static int virtio_gpu_resource_create_blob_ioctl(struct drm_device *dev,
				void *data, struct drm_file *file)
{
	void *buf;
	uint32_t device_blob_mem = 0;
	int ret, si, nents;
	uint32_t handle = 0;
@@ -620,7 +619,7 @@ static int virtio_gpu_resource_create_blob_ioctl(struct drm_device *dev,
			device_blob_mem = VIRTIO_GPU_BLOB_MEM_HOSTSYS_GUEST;
	}

	if (rc_blob->cmd_size && vfpriv) {
	if (rc_blob->cmd_size) {
		void *buf;
		void __user *cmd = u64_to_user_ptr(rc_blob->cmd);

@@ -672,7 +671,7 @@ static int virtio_gpu_resource_create_blob_ioctl(struct drm_device *dev,
	fence = virtio_gpu_fence_alloc(vgdev);
	if (!fence) {
		ret = -ENOMEM;
		goto err_free_buf;
		goto err_free_obj;
	}

	virtio_gpu_cmd_resource_create_blob(vgdev, obj, vfpriv->ctx_id,
@@ -705,8 +704,6 @@ static int virtio_gpu_resource_create_blob_ioctl(struct drm_device *dev,

err_fence_put:
	dma_fence_put(&fence->f);
err_free_buf:
	kfree(buf);
err_free_obj:
	drm_gem_object_release(&obj->gem_base);
	return ret;