From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:43888 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750886AbdGGJty (ORCPT ); Fri, 7 Jul 2017 05:49:54 -0400 Subject: Patch "drm/virtio: don't leak bo on drm_gem_object_init failure" has been added to the 4.11-stable tree To: kraxel@redhat.com, gregkh@linuxfoundation.org, liqiang6-s@360.cn Cc: , From: Date: Fri, 07 Jul 2017 11:49:49 +0200 Message-ID: <149942098931221@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled drm/virtio: don't leak bo on drm_gem_object_init failure to the 4.11-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-virtio-don-t-leak-bo-on-drm_gem_object_init-failure.patch and it can be found in the queue-4.11 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 385aee965b4e4c36551c362a334378d2985b722a Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 6 Apr 2017 17:59:40 +0200 Subject: drm/virtio: don't leak bo on drm_gem_object_init failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Gerd Hoffmann commit 385aee965b4e4c36551c362a334378d2985b722a upstream. Reported-by: 李强 Signed-off-by: Gerd Hoffmann Link: http://patchwork.freedesktop.org/patch/msgid/20170406155941.458-1-kraxel@redhat.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/virtio/virtgpu_object.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/virtio/virtgpu_object.c +++ b/drivers/gpu/drm/virtio/virtgpu_object.c @@ -81,8 +81,10 @@ int virtio_gpu_object_create(struct virt return -ENOMEM; size = roundup(size, PAGE_SIZE); ret = drm_gem_object_init(vgdev->ddev, &bo->gem_base, size); - if (ret != 0) + if (ret != 0) { + kfree(bo); return ret; + } bo->dumb = false; virtio_gpu_init_ttm_placement(bo, pinned); Patches currently in stable-queue which might be from kraxel@redhat.com are queue-4.11/drm-virtio-don-t-leak-bo-on-drm_gem_object_init-failure.patch