From patchwork Fri Jul 20 14:11:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damir Shaikhutdinov X-Patchwork-Id: 10539701 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD2BA157A for ; Mon, 23 Jul 2018 07:20:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3EAC2855D for ; Mon, 23 Jul 2018 07:20:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B234528560; Mon, 23 Jul 2018 07:20:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 787EA2857D for ; Mon, 23 Jul 2018 07:20:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 28E256E1C9; Mon, 23 Jul 2018 07:19:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0ED256EFF7 for ; Fri, 20 Jul 2018 14:11:51 +0000 (UTC) Received: by mail-ed1-x543.google.com with SMTP id t3-v6so9888431eds.3 for ; Fri, 20 Jul 2018 07:11:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ugXctxFCCDcwCpx8lN4nwzjkZieC2Ch8TgBJcxowsBo=; b=bRj4xOegbCaB3qmKfZega1ZW/k1RedOvltogWCqvYRXedOJiAN28M8J17Agkm/FlNA 3GG5HJkZbpRK+lV/4jWkqR7N1D6X4FAmHR5G7bZfONK5N6MjvJggQgIjB/Y7j2/SQSch MzEqi5ZCMwNgrwCohix2fWog2k2ouANF5RI2b1tbc62XJslDnlyoC469zcB1Zq/Zs0xS IhLKNleSUR3+ipWkxSzalPht67A3/Qs1lu9w84mi88KHcmI+M59g61QoJPRhjqhv0Ths T9idkHZpYmFkqAFpt6jbL6FPlbHZwPTCeQTvADWjNbNnGm8Lz2pnPd8eT0tEie8AeRr4 lDRQ== X-Gm-Message-State: AOUpUlGP7hEWytFztEfG+pcK36bwFaRwkZSeN72jnNBW9Ab0pN/Bm8Oc 10srgHUuM0bqzQpgeerrSwM= X-Google-Smtp-Source: AAOMgpekpYanARdcKx5VFyTZbVX/tYEsLQ3Z26s5pbdO22Ko6ILfVUTbtnNDTFG4BofqDLgbbvMFXg== X-Received: by 2002:a50:9493:: with SMTP id s19-v6mr2843338eda.285.1532095909735; Fri, 20 Jul 2018 07:11:49 -0700 (PDT) Received: from os-lin-dsh.open-synergy.com ([217.66.60.5]) by smtp.gmail.com with ESMTPSA id j16-v6sm3391749edj.71.2018.07.20.07.11.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jul 2018 07:11:49 -0700 (PDT) From: Damir Shaikhutdinov X-Google-Original-From: Damir Shaikhutdinov To: aerlied@gmail.com Subject: [PATCH 2/4] drm/virtio: Remove incorrect kfree during connector destruction. Date: Fri, 20 Jul 2018 16:11:41 +0200 Message-Id: <20180720141143.15469-3-damir.shaikhutdinov@opensynergy.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180720141143.15469-1-damir.shaikhutdinov@opensynergy.com> References: <20180720141143.15469-1-damir.shaikhutdinov@opensynergy.com> X-Mailman-Approved-At: Mon, 23 Jul 2018 07:18:41 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Damir Shaikhutdinov , dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP In function virtio_gpu_conn_destroy a pointer to a containing structure virtio_gpu_output is received using drm_connector_to_virtio_gpu_output (container_of), and then it is passed to kfree function. But this pointer points to a member of array (vgdev->outputs + index) (see vgdev_output_init): struct virtio_gpu_output *output = vgdev->outputs + index; struct drm_connector *connector = &output->conn; ... drm_connector_init(dev, connector, &virtio_gpu_connector_funcs, DRM_MODE_CONNECTOR_VIRTUAL); Signed-off-by: Damir Shaikhutdinov --- drivers/gpu/drm/virtio/virtgpu_display.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index b6d52055a11f..d211d4e98b46 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -243,12 +243,8 @@ static enum drm_connector_status virtio_gpu_conn_detect( static void virtio_gpu_conn_destroy(struct drm_connector *connector) { - struct virtio_gpu_output *virtio_gpu_output = - drm_connector_to_virtio_gpu_output(connector); - drm_connector_unregister(connector); drm_connector_cleanup(connector); - kfree(virtio_gpu_output); } static const struct drm_connector_funcs virtio_gpu_connector_funcs = {