Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp876511pxk; Thu, 17 Sep 2020 20:03:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhQD/ooNJN1+46shAqP5afVEiPaawiBcmgrNe9MSRhEnAVZ1FchWbfMVS86n4716fKq20i X-Received: by 2002:a05:6402:a51:: with SMTP id bt17mr23445842edb.186.1600398205577; Thu, 17 Sep 2020 20:03:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600398205; cv=none; d=google.com; s=arc-20160816; b=qRCi7AEFEPufLKy9qcFJRWzB5VUlTwJaUfLM+l0833fWA5hbHiWdi1zB4QlHpfc8zs JxkFcbqe5c7JbWx3o0k/pyNP1uHroICrz+DpgbuJbChsPzqSedgU7+qUl9hJKiFTXdhW m8esnqoRySXQRpIhYkuOBIj3oNf6UekaSWbOKMMqbnfcXIKRCTQ5cQPZmJVTGZo7fhvP KK9u5VgzRV7QjSAgvvgBFJa22cssUYd3/rHZAcPYQXmeF+f9D9wMHRp4rmnSnK+p+r6L BWrcfxUygXaPNqJdGAkGP3rWAWf30TqX0MkPgRMx2Yw5hQAjrq7fuenFElUWkwSX7hZq zJbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ImzYFdv7FV86GEX3X/1tw1hfTU6H6hUSLVTXY/iYER8=; b=mgBGSPQZdw6Nc8BPYiN1CVQlNkqOlYWKtgTDUUlQl6vKq92N5cBlnwvbASx9GBuZTX OaRBGQCQK1y4l8F34I9+1Iep0+i9AH95m6LyJwpdrdttndcpl8fTwBxAUyeNkprJJzCv v8heJrav/4ias2Y74rFS3nW21orY1jFzjp6rC22T+Zhu0LdHfh1uQZZeP5T+6GP26u8N 61MHzH3R+W4RlqUDxU5D9WdAXb/fQp5jswhOSaEUs0ZnUDDYQfFM6IGLYosNP34vyF7Q VQ7WLr+1RhJDIIiCHDwKgIz6fz9P7RSc/6Oq3UhvlNVuzw77sulQp20LCUgw8CEQgNXX 5c6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@anholt-net.20150623.gappssmtp.com header.s=20150623 header.b=Y58xKi1o; 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 v26si1175044eja.287.2020.09.17.20.03.02; Thu, 17 Sep 2020 20:03:25 -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; dkim=pass header.i=@anholt-net.20150623.gappssmtp.com header.s=20150623 header.b=Y58xKi1o; 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 S1728385AbgIRC7X (ORCPT + 99 others); Thu, 17 Sep 2020 22:59:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727678AbgIRCF7 (ORCPT ); Thu, 17 Sep 2020 22:05:59 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4CE2C061756 for ; Thu, 17 Sep 2020 19:05:58 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id o8so5924562ejb.10 for ; Thu, 17 Sep 2020 19:05:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anholt-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ImzYFdv7FV86GEX3X/1tw1hfTU6H6hUSLVTXY/iYER8=; b=Y58xKi1obOp2IninGGVaFXvJGsFdsmII8kZ+jjhOcGrqyYoWPKMSQuXr1fQOhMXDH7 ke7OElRKM0lP/hUCKkFBTvxbnmcrdq8oW+XdwHOxwkf7zLpn3V350ZdQZ3wiTro5H1w9 NufqIxN544+s5HOUZ91dQ1QSuFHGmjewxAfFYNqCStBz05lQIOYb59kYUSJqfbYpvw32 BZ4k3oEBJRlfZ6KTuCgywM3T13KJPRsnM6XZoEtjsTLa6FHTEiarx8PMfGG4PViqHJam 3BiziNkfZFVdTo7dd7iTEAAe62jUVzgPBjXCC7cBiMbPzBYm7tv7De5ycK9NdPELUd6g iHXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ImzYFdv7FV86GEX3X/1tw1hfTU6H6hUSLVTXY/iYER8=; b=TUuWuowls59qkNM+iY8zMFp4kJHoKKCqOP3ooAvIm+i++9HkYCn6gxTx3OmH8EvBhH KTbkMemqx+2ogc7nXpp1H0Z6FkTYDmPoyEzOX8YeqWPAvsqrOjG5K7rnYneOHJ+MoJHw H3Zn0dcGO9RVRqkhUN5qUCECwOvgKK8vEUzxykOyfVlN3y77U0wPbyxXVfY9KLFvZsvN 10OpKMS7mrlrFmOL6YAwSw6OpLM4w6vTPnZIkkn8xKYNXZQPi6kNAdEUiuAcpLfr1WTc T0poBZzQDc8hrs4AoWCadqqXZlytCqb8P/vniZ3k8JIFkdf0bwIOBa0iAWBOiIoVpYAC IEqA== X-Gm-Message-State: AOAM532n48GB8Pml9XIrOdZWER9j8jAX2kEKZ/5yXTXeCyuwKJdiOwS5 jro0sOfOoHB6GTHNjJ2qWkxPXWTV0yFFHOOXutqXCw== X-Received: by 2002:a17:906:37c6:: with SMTP id o6mr22553734ejc.404.1600394757373; Thu, 17 Sep 2020 19:05:57 -0700 (PDT) MIME-Version: 1.0 References: <20200918020110.2063155-1-sashal@kernel.org> In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> From: Eric Anholt Date: Thu, 17 Sep 2020 19:05:46 -0700 Message-ID: Subject: Re: [PATCH AUTOSEL 5.4 001/330] drm/v3d: don't leak bin job if v3d_job_init fails. To: Sasha Levin Cc: LKML , stable@vger.kernel.org, Iago Toral Quiroga , DRI Development Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 17, 2020 at 7:01 PM Sasha Levin wrote: > > From: Iago Toral Quiroga > > [ Upstream commit 0d352a3a8a1f26168d09f7073e61bb4b328e3bb9 ] > > If the initialization of the job fails we need to kfree() it > before returning. > > Signed-off-by: Iago Toral Quiroga > Signed-off-by: Eric Anholt > Link: https://patchwork.freedesktop.org/patch/msgid/20190916071125.5255-1-itoral@igalia.com > Fixes: a783a09ee76d ("drm/v3d: Refactor job management.") > Reviewed-by: Eric Anholt > Signed-off-by: Sasha Levin You're double freeing with this patch, the bug is already solved. > --- > drivers/gpu/drm/v3d/v3d_gem.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c > index 19c092d75266b..6316bf3646af5 100644 > --- a/drivers/gpu/drm/v3d/v3d_gem.c > +++ b/drivers/gpu/drm/v3d/v3d_gem.c > @@ -565,6 +565,7 @@ 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.1 >