drm/virtio: Handle context ID allocation errors
authorMatthew Wilcox <willy@infradead.org>
Wed, 26 Sep 2018 16:00:29 +0000 (09:00 -0700)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 29 Oct 2018 21:50:55 +0000 (22:50 +0100)
commit6a37c49a94a95d4cd8ce4e7466f3bbb17e80ca64
tree0a6b6d23e0056a6f635f36ec79f69b2b9c4bcaa6
parent1938d1ae32fefa172288e3a9245ae126640c5c10
drm/virtio: Handle context ID allocation errors

It is possible to run out of memory while allocating IDs.  The current
code would create a context with an invalid ID; change it to return
-ENOMEM to userspace.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20180926160031.15721-3-willy@infradead.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
drivers/gpu/drm/virtio/virtgpu_kms.c