Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp743733imm; Thu, 13 Sep 2018 07:08:01 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda5r7ynA1CzwEITgyQsu241t/eaWiH7tmeITdx35EZfmgmzbLn0iaESFYamHiZG56ZH7xBY X-Received: by 2002:a63:5a4e:: with SMTP id k14-v6mr7496433pgm.297.1536847680927; Thu, 13 Sep 2018 07:08:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847680; cv=none; d=google.com; s=arc-20160816; b=wDCQDgM3ft57dOv8A3GoSsSnpPMzB3CPNhnWtH+YfZw1paLb6OZdCLO+w65GXm0I9w 7ff6DI0Ig7Gt4qZo5oYyJz71z3yEdJoiAwB+HZxi0LGUGMDV0duL3AnW4N6P8p1Jm9A4 mA+RxkjRnBBtTuNoUUk7nQ/rs2+/5TmZj/tgTt27cryk0/EZl2ghNh4VVV7I0/uq4fKH h/jHyZd/HfM3dROgsp4yN5PCZOfYJf6L3yh1LuK3i83SMSCqLltDykb3jS2FT72tNt72 vrUsF0Gi5s2n5aKudMemLU4Uv6wH5Sfx/VzLUlcAqCu7UIuky6p9OKUWoS14MfvB++kT oAEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=6cG7KndsnyHSkOwjwm2kSMs/1xamqjoekk/tZ1cimrU=; b=qFh9MoE+2XNwrFX30yWavI6tWL/uFaviz397HC+cAMThdVaT/Al6dnYdQHFugyKsMD nqarKmcoo5EENHfCVRC0Fc2qfOHZ/uQcMUn32z1h7gWIORoydMP7qyL2ujpq7L1/Xrux B8IRxQUgLMsjmGpl3c3mx1yIX15PimW2Wgw+EhMgfDnNrn0kS7T7N577soxu8s+5ZBN5 SN8M27pQCgaLc+Y/O29li8kBp4DE316VrlrRAyOq4VwY8BXwKj+kG57Rf6SUCutOXLTV +zUV7lWNYievi0HFBQ7a4NDjRuCGWoM6GAaSmYA9ErsHxtl43R7z883DcyCu9fTn05wB OShw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z73-v6si4079796pgd.471.2018.09.13.07.07.45; Thu, 13 Sep 2018 07:08:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729476AbeIMTPm (ORCPT + 99 others); Thu, 13 Sep 2018 15:15:42 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35552 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727995AbeIMTPl (ORCPT ); Thu, 13 Sep 2018 15:15:41 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E9E39D36; Thu, 13 Sep 2018 14:06:01 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian J Wood , Ramalingam C , Sean Paul , Jani Nikula , Rodrigo Vivi , Chris Wilson Subject: [PATCH 4.18 155/197] drm/i915: Free write_buf that we allocated with kzalloc. Date: Thu, 13 Sep 2018 15:31:44 +0200 Message-Id: <20180913131847.751857757@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rodrigo Vivi commit 1b1b1162745e5f9e5c6c095afc8081df3edabc50 upstream. We use kzalloc to allocate the write_buf that we use for i2c transfer on hdcp write. But it seems that we are forgetting to free the memory that is not needed after i2c transfer is completed. Reported-by: Brian J Wood Fixes: 2320175feb74 ("drm/i915: Implement HDCP for HDMI") Cc: Ramalingam C Cc: Sean Paul Cc: Jani Nikula Cc: Rodrigo Vivi Cc: # v4.17+ Signed-off-by: Rodrigo Vivi Reviewed-by: Chris Wilson Link: https://patchwork.freedesktop.org/patch/msgid/20180823205136.31310-1-rodrigo.vivi@intel.com (cherry picked from commit 62d3a8deaa10b8346d979d0dabde56c33b742afa) Signed-off-by: Rodrigo Vivi Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/intel_hdmi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c @@ -933,8 +933,12 @@ static int intel_hdmi_hdcp_write(struct ret = i2c_transfer(adapter, &msg, 1); if (ret == 1) - return 0; - return ret >= 0 ? -EIO : ret; + ret = 0; + else if (ret >= 0) + ret = -EIO; + + kfree(write_buf); + return ret; } static