From patchwork Fri Apr 20 18:59:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10353531 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4F9DF602B1 for ; Fri, 20 Apr 2018 19:00:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40D0128830 for ; Fri, 20 Apr 2018 19:00:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35A3728834; Fri, 20 Apr 2018 19:00:16 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 11CB128837 for ; Fri, 20 Apr 2018 19:00:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6242E6E6E5; Fri, 20 Apr 2018 19:00:11 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb0-x242.google.com (mail-yb0-x242.google.com [IPv6:2607:f8b0:4002:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C46B6E6E5 for ; Fri, 20 Apr 2018 19:00:09 +0000 (UTC) Received: by mail-yb0-x242.google.com with SMTP id t8-v6so3364325ybo.9 for ; Fri, 20 Apr 2018 12:00:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=eoboDEkHJ2jUv/vJLg0rxR1N98r4qI8BSSyE/TnTix0=; b=kbSQs2WjVy+V9tMCI8FoHIUWZuTHOPDq9EkpKSmyOUyHjEdLm0tvwcQiHmwIUU1NVe KzpQDvubRu57rH+wbnt/ivjO7ZcjdeYY/TB5w1eEtl3ZjrUHiPlRKUY+ByZS48hc0E8h dMurJgkHh9mzIdm6SKjQzzVbVwgQUCgLq4i6Y= 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; bh=eoboDEkHJ2jUv/vJLg0rxR1N98r4qI8BSSyE/TnTix0=; b=bOLFNv7h3oN2OYAYqgRbe6YJm5ya7t57V7cRQFbM6nNzJKaGjqru2FqPSoeeGKv/KY lB16jOCVr/J5E4Puz5n/s1yM0E47K6TM0c7sGzxZRLZOu+n2C+z5V/35/tGq2FdUkE86 CkHL9Bbu5fNJrReTWLsJ3shLpIjv9uu1b/N7n6wQJKsmRYpFwdqZNcttb6nKNlLwnkss GFbVNWUzFfRUmt4HJf0+U1IHJkLazs4CFnacy6myqkmiLDXTAJW33w3/hAgtmUBdJbLn noSs/BzcId6W3nJOsx9ZW3ISsyazfbjT0n869K0/yGDceRdUcPOvJpEKWBof55ZF1Fgx x01Q== X-Gm-Message-State: ALQs6tDt+GO7TmxDv533a36Hxsfx2TKrQ57FyMWvLqUpuCFk9UzZKHCD QiW0QbJXYFPIi2AlQGsk/CLOVYJG7pI= X-Google-Smtp-Source: AIpwx49nkD4sVu5B3/BdIDKJWlhjSAfREe8y1ss0jiSfOFFtBAno/AxzOeU4VNntV1HSxuw1HuK2Qw== X-Received: by 2002:a25:b44c:: with SMTP id c12-v6mr3852067ybg.78.1524250808628; Fri, 20 Apr 2018 12:00:08 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id k6-v6sm2776990ywi.11.2018.04.20.12.00.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Apr 2018 12:00:08 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/bridge: vga-dac: Fix edid memory leak Date: Fri, 20 Apr 2018 14:59:59 -0400 Message-Id: <20180420190007.1572-1-seanpaul@chromium.org> X-Mailer: git-send-email 2.17.0.484.g0c8726318c-goog 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: David Airlie , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Laurent Pinchart , Maxime Ripard MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP edid should be freed once it's finished being used. Fixes: 56fe8b6f4991 ("drm/bridge: Add RGB to VGA bridge support") Cc: Rob Herring Cc: Sean Paul Cc: Maxime Ripard Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: # v4.9+ Signed-off-by: Sean Paul Reviewed-by: Laurent Pinchart Reviewed-by: Maxime Ripard --- drivers/gpu/drm/bridge/dumb-vga-dac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/dumb-vga-dac.c b/drivers/gpu/drm/bridge/dumb-vga-dac.c index 498d5948d1a8..9837c8d69e69 100644 --- a/drivers/gpu/drm/bridge/dumb-vga-dac.c +++ b/drivers/gpu/drm/bridge/dumb-vga-dac.c @@ -56,7 +56,9 @@ static int dumb_vga_get_modes(struct drm_connector *connector) } drm_mode_connector_update_edid_property(connector, edid); - return drm_add_edid_modes(connector, edid); + ret = drm_add_edid_modes(connector, edid); + kfree(edid); + return ret; fallback: /*