Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1792078ybn; Thu, 26 Sep 2019 02:14:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwm9g4ll3yZQzpeJ6ZrQ0TBZS8+nHWz1g0Ape/KCXj+x3TnOf6zszgcwKu0ZT4DjVHbUU7 X-Received: by 2002:a50:8a9d:: with SMTP id j29mr2417598edj.283.1569489255686; Thu, 26 Sep 2019 02:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569489255; cv=none; d=google.com; s=arc-20160816; b=FKbG3plpfqFeTaHeVLpMtDQi2LzGPTtcv2z70jrgIeDN9+TOzwGpVnBXBzkWDnuPOe +8wA2rgIDyqs9k9k+prPznEl95oa3T18tVLRLKJ2btv7FruRIgfx6WVfeEwEj4Rzymsg Ao5r5K3Uzk0xwCCITsBMeT8lglktsDSZOMNnCSSVjR1MQeno47OSxAL15Jek3TuuHvCQ OoyVlP3BnrESdlXl7qqNWf/JtoKVB5BtNbkSB0VV/bNObsw2Ub0hvwd/nN+JFdJDi2dd +PEySpa00Ab4lFJWzosoA8kW0I8IInqB0kIkYgxvkVmmt79l3ntdpy1XT+T41MBCR34R z3TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:message-id:date:subject:cc:from :dkim-signature; bh=Een0CpGnMmjlIwv6SGvcNYXFPmeEyRahY8Cx/ZLw6Cs=; b=X/wM1PD2h3Ju3e7oGn/8sUMBiJkdwKc4yOiEhngbJdKAlBnjD9l+s4B8iOD2/D+YdS KIwPq/9wqPQ5UDmfCSKuQDNwfvVzVu1LtAAYqX2GJyNeooBRHGiCIg2jo8uPpLINjtdr 5r4XeLFA+TVsPk/Tj4atTWJ6dWSlV5QwmVAcqvr3Q2Ezr4AV+n3qmAh0sqt972r/BWP4 YCg5xtN51zythN/qqkYCPUYSfOOo5nDK2yDNS0BfAYzGvVo4MQg9nA2jZnK8y6uI8a84 9akY/yN+8+4LwIdwvMWngpBhKukoo5AWK3MMrSmntyTLym6hDb0QDn54t3BXBspgtnfa z2QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=DLSdyfZ7; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ok21si684531ejb.95.2019.09.26.02.13.51; Thu, 26 Sep 2019 02:14:15 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=DLSdyfZ7; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2442268AbfIYEam (ORCPT + 99 others); Wed, 25 Sep 2019 00:30:42 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:42027 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390426AbfIYEam (ORCPT ); Wed, 25 Sep 2019 00:30:42 -0400 Received: by mail-io1-f68.google.com with SMTP id n197so10155199iod.9 for ; Tue, 24 Sep 2019 21:30:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Een0CpGnMmjlIwv6SGvcNYXFPmeEyRahY8Cx/ZLw6Cs=; b=DLSdyfZ7jMpKvSBsDSe7mOpAysxnrw6UY6qtMxOjDFe9vauIc1eUtuQkHTRe9saurj sUUAYFB/R+ae8fTscfHi6/muabc8G1gFEydiAZM8qAqKnIxbvOuYB4zWpWzmt9dQiYCE rHDv6db0OavUV30UpKkXkowxibuS6fjz5+1ud3L9CgQ0m2xMRGx8ql7XaNFC3ywAWJxV MjsC0INc0XpGuC+YgC328Pz2Y5IssNWwN2PemFjnEHftVZXdB0E7Z7Bh2Qoc6d/CVvEM HtPD+XfgI0bE4VSspBvxxDJiFwSp1CbmHP0WelXA5DBSZjSwCHfGBS/rIRcjOaSnlrHm TFiA== 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=Een0CpGnMmjlIwv6SGvcNYXFPmeEyRahY8Cx/ZLw6Cs=; b=fkFl7d18bdWqw05x7BXTjyWf2VfgHmHi4pgaiJCfIti7D6K8ksY/+p1CWcK/8swgmE wl77l49Mt8hK5pOnYh2q0rfjTIIyRmEbFSXZy+e5Gx5+JH6bSwYrZIFPLpzSfjQIe1Io hPqaXlqYzX4KlTQWV3HXxE24O4P3OlsP3MopzJfQ5E0h1wwSKzdKJIZvhqjh9U+euE4Y G2jsg67nVk9KYOH0a78wyyKAzr92x2mcUVXHeT1Lbf1V8NFyjCqmpvtilVaDSXqOeQVI 81Qc2+fkC5aqMz3T+H570eAcjvuzBvX7NWrjTuNWCJlWabh9+Cyuyqw02JWizhYnSxMM mE5Q== X-Gm-Message-State: APjAAAVV3d3ZA+UxOtQL+whKWLTIEIn0GXYycor8WezHTQKdIiefzOJJ mrZv9ApwbrxYjFwMRH/xbtk= X-Received: by 2002:a5d:8f92:: with SMTP id l18mr4766636iol.143.1569385841381; Tue, 24 Sep 2019 21:30:41 -0700 (PDT) Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) by smtp.googlemail.com with ESMTPSA id o16sm42508ilf.80.2019.09.24.21.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2019 21:30:40 -0700 (PDT) From: Navid Emamdoost Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu, Navid Emamdoost , "James (Qian) Wang" , Liviu Dudau , Brian Starkey , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/komeda: prevent memory leak in komeda_wb_connector_add Date: Tue, 24 Sep 2019 23:30:30 -0500 Message-Id: <20190925043031.32308-1-navid.emamdoost@gmail.com> X-Mailer: git-send-email 2.17.1 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In komeda_wb_connector_add if drm_writeback_connector_init fails the allocated memory for kwb_conn should be released. Signed-off-by: Navid Emamdoost --- drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c index 2851cac94d86..75133f967fdb 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c @@ -166,8 +166,10 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms, &komeda_wb_encoder_helper_funcs, formats, n_formats); komeda_put_fourcc_list(formats); - if (err) + if (err) { + kfree(kwb_conn); return err; + } drm_connector_helper_add(&wb_conn->base, &komeda_wb_conn_helper_funcs); -- 2.17.1