Received: by 2002:a05:6359:322:b0:b3:69d0:12d8 with SMTP id ef34csp436961rwb; Wed, 10 Aug 2022 10:35:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR54Yw94rmRyg2pUBj38hiscz1NjFfqulosCdcwujSodfiG1TZGtN7w6xa961FcbtN3asAsj X-Received: by 2002:a17:907:7637:b0:730:6a9b:148f with SMTP id jy23-20020a170907763700b007306a9b148fmr21549860ejc.273.1660152903052; Wed, 10 Aug 2022 10:35:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660152903; cv=none; d=google.com; s=arc-20160816; b=WQnC9FxZtDSjw2KY6ky+5nTVtMfjZ1MQpbyE9H0gMCBVYlomhYNktFTEZLuMTPm3rw rbn24cnjlTPRGrajWJ7kAQqAPzEis8GUNPhU/i5tGX1f4aocslCWh8gLSAwCP+7K2mjJ KGvNnmniPkN5IpN8U3VUktD9W2GMmqUCu04ROSBfAmuD96T3je0QMeg/6NGEL0W2W/hm FOt3r70AOVDJGnGZ8fs7DIshqPMF+Tgxr++4ZYeeOFfLhG0iIIqGCIQPfUB0dX+LW0Tr 4QmGrvcwuprchC18QULlLKuZXHjn62jqdFjLUhrpLX41SsPSUNgdQ/TSvoyvibAUmB2I K5Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=XTiTJ4FxwpWw84LKiNSYSTO/gnrN5qUZqhqmKW/Gh4w=; b=IGMo7kr+N4un3tbKiIbmwXGrfIt13+0fV8aZ3RPrqZ/DrgYqES5bEH+SBYTSLT9fhb M4tQ3geZhn2uZNrTPC8Vuxip1xGhGuEOz1XxtICtU262QJHYaYBmYONc2g2/oZ4RrYH+ cmd3zgZsPnXQCCIkLjaKS3OUwfQ/vGKEQg6/3JhVl0/W0vM6GZ7i0uQTmh1MuVcOJRQd KoDm1riIfsY4UknJMvJSoVYtocEh+NuV0HSzT9SnwnMeILvSt/8IwoKtudeWexlCrM+q wMs8UhXXmSgNRlGyq6aweh2Rhitr7ezx/zwAVWkSRHYs3vXbTsBGlWD32SZLlMqzvr2T dJbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iga87Q0F; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gy3-20020a170906f24300b0072a9d2d2d37si4619966ejb.116.2022.08.10.10.34.36; Wed, 10 Aug 2022 10:35:03 -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=pass header.i=@gmail.com header.s=20210112 header.b=iga87Q0F; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232926AbiHJQl2 (ORCPT + 99 others); Wed, 10 Aug 2022 12:41:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232981AbiHJQlZ (ORCPT ); Wed, 10 Aug 2022 12:41:25 -0400 Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ACF01101 for ; Wed, 10 Aug 2022 09:41:23 -0700 (PDT) Received: by mail-ot1-x32f.google.com with SMTP id z22-20020a056830129600b0063711f456ceso3062916otp.7 for ; Wed, 10 Aug 2022 09:41:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=XTiTJ4FxwpWw84LKiNSYSTO/gnrN5qUZqhqmKW/Gh4w=; b=iga87Q0F4KLtml0NyMbtr1doo/KawlNydW0obAC9W9XBiNKTLuc1dMMr/L4myWJJ96 RjUTWxAXFZr3TjlQ21zg9Of0DCXVXPRilL9UrcA8kO7QEhdtNkFddzJx/QOHI8CbQWIm 7W4UcXySZoD/kMnHqpgnbDT3yf1ctBtw3XpjfDz/Nv3fYhMV3x1Ui3sG8O73WGnfFMAe Y7LRSZCv7bOs1dQa/KbAX9s7/bHvJnL0OAzEIqFm0nxq3ObFt0VMZrAPsC0ZvUDh/IZ6 4hVNzZlY6ScDa9WRaxIODBundsFeu2eK/lej7WY//Sp2ZdQVZX4euO6ivO6wgJNB8C4U J1vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=XTiTJ4FxwpWw84LKiNSYSTO/gnrN5qUZqhqmKW/Gh4w=; b=Dvf3qYx4IPcvtJ651ncKTVil+sZkqpnPV2fLeqS6wes+RFt+HS6yalIsYvN5h7GVGr 9xwts3T+D3FSVxcO4BT+umZt5pzKLSj5WZc4W7iHpH96TA8/g989yIhtbwn7ayA0Ke4V MKRIImxCMyJOlDMssCq+4i2HNcvE3/qBbdz/rIukUlFjbXdn5hXdv+wWkZ6gzHiFoAxU ZUJADGTVCm2a0AVUIAsCEijA9aFjxbtGcOGK6KMRGaHgEqjmZs0jWbQkT35jDs7ggSkb tqNv/GU4a/LP+f0xNaGS29CjB1o3ZQQ+9aApMt+ayQ4Zw2MvW+d6OtXWgRzQzeq+KRN/ BEIw== X-Gm-Message-State: ACgBeo1A6xMRox/HPIpb55av0+C6OlHmnBWqAmfXB6L/1IfFcCy8HHFx N4ZMZWe36JlnvWO7lXBk/zACkrbVnTZsl9/H1gTwtczt X-Received: by 2002:a9d:c64:0:b0:636:df4c:e766 with SMTP id 91-20020a9d0c64000000b00636df4ce766mr5897353otr.12.1660149682412; Wed, 10 Aug 2022 09:41:22 -0700 (PDT) MIME-Version: 1.0 References: <20220730034923.25500-1-mailmesebin00@gmail.com> <31187f41-64c8-d7ce-fcf2-5da421b3e194@igalia.com> In-Reply-To: <31187f41-64c8-d7ce-fcf2-5da421b3e194@igalia.com> From: Alex Deucher Date: Wed, 10 Aug 2022 12:41:11 -0400 Message-ID: Subject: Re: [PATCHv2 -next] drm/amdgpu: double free error and freeing uninitialized null pointer To: =?UTF-8?Q?Andr=C3=A9_Almeida?= Cc: Sebin Sebastian , Tom St Denis , Lijo Lazar , Somalapuram Amaranath , David Airlie , "Pan, Xinhui" , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, Nirmoy Das , dri-devel@lists.freedesktop.org, Daniel Vetter , Alex Deucher , Evan Quan , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Applied. Thanks! Alex On Mon, Aug 1, 2022 at 1:08 PM Andr=C3=A9 Almeida = wrote: > > =C3=80s 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=C3=A9 Almeida