Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3758971pxk; Tue, 22 Sep 2020 01:33:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJya4Nj3oVubY9vbnmsSlpHDUC0CXcSi4HqqaBvHHPGKrLv3sWNC5bzEFY3QSyqDUod6/X/Z X-Received: by 2002:a17:906:7e42:: with SMTP id z2mr3666577ejr.206.1600763634484; Tue, 22 Sep 2020 01:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600763634; cv=none; d=google.com; s=arc-20160816; b=xCBSfXxaUj96fRk4OYVWhDaAeXF+eBS4CnjvRBfgahNHW3uhq/nU6tb2ACqLdnyEro qXUJpzltQ2vRM3sRkPnwkCCksFx3js4Ip0eJXaLWGgKA9/+s+gFtEPpqNdshHj7Cm3ao So4LQ8Hsa6OQePm7YDTJAVq9puVMMmx1FWkz//biLM5qkBfPFos5dw2K23oPK8EygRwO AoNWO/nRytXX9+5CKI0dMT34HVjSaVJfISKuOeVxOaBWtdAi+qV/0xpVyAhDdMi5YjIs dCQ4WXURlxq4VNtaO5EvmwDw0BCB99wIOS0+aONHKkTkpsDXhi6QvYMsJRu6bs+dfupd hI3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=tBsjqDGsFVZ6mVOmQCcDCkNeyf5vOROH79qJ2mOfXkQ=; b=aG8WbAGu2Bmxiny8W1mERXBVQ/W6TXvb4bz9b3zEoBdXJhBR45XXEhqmpCGNWBF00G 5bFHhhLNSyDLrm/Rt1wCE5en0TtHfrzmugjxb1/DTMY23lU+JPiSubVNY29xp6N0CZex 8i4q3sZee0gtO+ahRKdmu5CeSfja1g2kw13mEiBWhh86AcbjckqB+yUwuUqGN9/Eaaed Yeakhve9OOLBTI9ptmqFrvpyUwCh+17opNWT+XSY38eDIKBI+I3DQ75mB5pTC94sNkWq DRen5HvtA4rvqWkvVbg91sMGQ5CLJjDeus6xydohBUtLMqKuhWsEYzEeCxJpHPyl2cVT da1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m16si9746037edr.280.2020.09.22.01.33.30; Tue, 22 Sep 2020 01:33:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729897AbgIVH1c (ORCPT + 99 others); Tue, 22 Sep 2020 03:27:32 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:14206 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729748AbgIVH1c (ORCPT ); Tue, 22 Sep 2020 03:27:32 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 6C84ACA9D860768E21DA; Tue, 22 Sep 2020 15:27:29 +0800 (CST) Received: from huawei.com (10.175.127.227) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Tue, 22 Sep 2020 15:27:19 +0800 From: Zheng Bin To: , , , , CC: , Subject: [PATCH -next] drm/v3d: fix double kfree in v3d_submit_cl_ioctl() Date: Tue, 22 Sep 2020 15:28:29 +0800 Message-ID: <20200922072829.1167244-1-zhengbin13@huawei.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If v3d_job_init() returns with an error, the storage addressed by 'bin' is freed a second time. This patch fixes that. Fixes: 0d352a3a8a1f ("drm/v3d: don't leak bin job if v3d_job_init fails.") Fixes: 29cd13cfd762 ("drm/v3d: Fix memory leak in v3d_submit_cl_ioctl") Signed-off-by: Zheng Bin --- drivers/gpu/drm/v3d/v3d_gem.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c index 915f8bfdb58c..182c586525eb 100644 --- a/drivers/gpu/drm/v3d/v3d_gem.c +++ b/drivers/gpu/drm/v3d/v3d_gem.c @@ -568,7 +568,6 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data, ret = v3d_job_init(v3d, file_priv, &bin->base, v3d_job_free, args->in_sync_bcl); if (ret) { - kfree(bin); v3d_job_put(&render->base); kfree(bin); return ret; -- 2.25.4