Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2078094imn; Mon, 1 Aug 2022 10:17:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR5cIgZoN36mv2twZAnd7tPz8h8KdeGRGNUazKIw3/RJSHgXUEw1cJw/fLDn1ibDRjGJEj8x X-Received: by 2002:a17:902:f790:b0:16b:d796:3696 with SMTP id q16-20020a170902f79000b0016bd7963696mr17640469pln.97.1659374256198; Mon, 01 Aug 2022 10:17:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659374256; cv=none; d=google.com; s=arc-20160816; b=zgmkcDNwhTQt2mJP35se8P8vkG0VKhSrds6kyrANPddThe+FqEhE37e64j36Qej55H 6OpkTzNj2EPbbnr9qVF0Y9BfiOeOcm8yd+UB1C6KgzuVCBrzKME//TSxzx2l2EpkqF79 jRRdhEm2+a1RZtcvmP6pOzdy9e8BLxEErEqK4+RDN7aU6YDZ5IYzWa55dabxq+U7WSil N5t+UpcJyAJMxHxK2MaaODhBczey9MBQA1Y5zVVj47pAoMBGX9TFlkNYiMhOvbRsdEDl E0Wv/Z8pSW8hQbRdCPmZQylr8MEqNF0QRueAVJPgtNK+ppH5EpFNO4Kyn8VinN1bnOb1 S1Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=lV6Nj9c4zvsHkFQy7tICycDimwo4Sq7catGYsp4e4OM=; b=ht61WTSaZTripo7DUXdmXZT0z6r51lDV6s58QWT//UEKyF0gjFFla6wlZ4ZPf+6tzN i8sgcIQZCxumE5sIQkQ2fgw1f4hiddUod84nCbWjo6mY3664RFTkSTaVf/tW5Iu8MH4p B4c/GhlMp4gJRvwr3bd3bBec/ExOuuLTSjbDJtQoOKI8zuYeuhGUTqD8wJt8mmPyIypS CEiPLTYO6sPsobR65zAiyBVyXrowovjOLVDZQ8XtH11dlqM89jQGnzcj6ogZAd5AOJUM HVFM8ImnLRb3CgT4PXxCLjVqj/O/kBO1hL7lIOZ0nLY+AhY1UkO20qxqBdP6YekM0jA1 R5TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=sszIulLj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m14-20020a170902db0e00b0016ec8565734si9409625plx.24.2022.08.01.10.17.21; Mon, 01 Aug 2022 10:17:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=sszIulLj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232144AbiHARHM (ORCPT + 99 others); Mon, 1 Aug 2022 13:07:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230298AbiHARHK (ORCPT ); Mon, 1 Aug 2022 13:07:10 -0400 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68D0310E4 for ; Mon, 1 Aug 2022 10:07:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=lV6Nj9c4zvsHkFQy7tICycDimwo4Sq7catGYsp4e4OM=; b=sszIulLjEmptCoufWV9wadwb/R IVtmrJZm/Vty1rFEIr29ikO/5UmW6LsYXtyEHOU5bNSRa0f0C7XJ/D2VNjmUmLuhv8TYhO2ACzj+h TMlhiuE69NL5c2Nj1cuv3LMv63tAj0pnuOFp2tLz/WbGmHVxPdo2WNN1xtKc+JcdIrUSalpQmXVCh huPAqm10mMtetvt4p7Loc8AdcjzwSVablv+s8SA8WPl+qGWiRydKvSFq3q22kyS8WhfBhnOAjafr7 2Ztmk+Q/0x7Guu7S9gYcwWbqktGLC3zLJS9HmC4Tm1N9W4tlTkiDshcMQ7BgSDEIzbcxbKw4mJfkz rm8KI8HQ==; Received: from [187.34.27.134] (helo=[192.168.15.109]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1oIYsd-00Dy7P-Lq; Mon, 01 Aug 2022 19:06:59 +0200 Message-ID: <31187f41-64c8-d7ce-fcf2-5da421b3e194@igalia.com> Date: Mon, 1 Aug 2022 14:06:41 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCHv2 -next] drm/amdgpu: double free error and freeing uninitialized null pointer Content-Language: en-US To: Sebin Sebastian Cc: Alex Deucher , =?UTF-8?Q?Christian_K=c3=b6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Nirmoy Das , Lijo Lazar , Evan Quan , Tom St Denis , Somalapuram Amaranath , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20220730034923.25500-1-mailmesebin00@gmail.com> From: =?UTF-8?Q?Andr=c3=a9_Almeida?= In-Reply-To: <20220730034923.25500-1-mailmesebin00@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Às 00:46 de 30/07/22, Sebin Sebastian escreveu: > Fix a double free and an uninitialized pointer read error. Both tmp and > new are pointing at same address and both are freed which leads to > double free. Adding a check to verify if new and tmp are free in the > error_free label fixes the double free issue. new is not initialized to > null which also leads to a free on an uninitialized pointer. > > Suggested by: S. Amaranath > Signed-off-by: Sebin Sebastian Reviewed-by: André Almeida