Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4473205pxy; Tue, 27 Apr 2021 06:03:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVygnK8C3HHAMPBOyXbbeK+QV2NYjSiY51CfSfkb7PgSV3wsGI961S2v2ub1Fma79AXJhW X-Received: by 2002:a17:906:1519:: with SMTP id b25mr23294081ejd.254.1619528589222; Tue, 27 Apr 2021 06:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619528589; cv=none; d=google.com; s=arc-20160816; b=U01nW+QVVUY/iZeVsa8elgulno507mL2IJykEcCtZ9twh+8YmZ6kvV0sPYb65wNShj 7n/QVwl2vCFLOeSNLYDbF896wfwCzvWa1f3OjMpXL8fqinwK9q/oEFfb3c17IabM35OR Aaf0Vv7TWQsyTUs30zU9FhA1awToAt3zLR+TUJNm6OemdrK4DRBhWLiwHNoi/90oLvRK jCeD17dksIfgDc0hARHHBRqLM1v/omtG+j4w51MTrhLBmjcNUmO41uaZcyIP3Hzw2Snw bcqH2bGkv6h6QieqZuoMOmRWRR0ssI9PALlBmGi9wKCCPQA5Yw35HNFp/YR+TSN/mJBv AiEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cy45R2h6MttJn/gIPzFuSNhp36CSw0vUkPj/RMQR8bA=; b=hMX382T1gHL/so/DzRijO4fmmgmvk24hpj2JKfG6IA0kWI1xUZ93GGsDetTIGcDrM5 i4NRFIoZ63NRAcwcaox581TuZO4GOUaGl0p/n/mtflL/4aM0vsfhLXNlKXfigUuUosel p9//dcI1CiGJUWS2d2QmpETIuHin3140uYU4pCyZ5cdsdTx3gqZOV6htXpLjzSgVrTHh otJMZ0BCG+BL5MHkEHQ143/T6ee3udNgH6sjpXaKzG1fBAappHk86QA/WJl/jErSSQzQ AEmG3Y+3xY0M7U27tO7N62ElRfRyEgqmN2Iume59pkAi0aCsj+7L22w/jlh1y8hIIOMX wTyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jNe3sAV9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f25si10585057ejh.704.2021.04.27.06.02.43; Tue, 27 Apr 2021 06:03:09 -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=@linuxfoundation.org header.s=korg header.b=jNe3sAV9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236121AbhD0NCY (ORCPT + 99 others); Tue, 27 Apr 2021 09:02:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:40856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235446AbhD0NCI (ORCPT ); Tue, 27 Apr 2021 09:02:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B514761078; Tue, 27 Apr 2021 13:01:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1619528485; bh=sKiJVqJdDA8khrlrCBEHKnnMwkutc3VNyQ1vNzwDdSc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jNe3sAV9hdM39rMM/W0pQPRGdh3/atDmX9ypzq//sam2NxwKvowIdcyL3aUEernRF dayvl3hHc+SnyWymBg3cdv2mfYwTZGu9lssI8Axzngq4imkEnf6bia5quvh9blW1Cv y7W4EsE4BNXver9BlIbmZrpTakpDi/pO/pliy/LA= Date: Tue, 27 Apr 2021 15:01:22 +0200 From: Greg KH To: Jens Axboe Cc: Peter Rosin , linux-kernel@vger.kernel.org, wang6495@umn.edu Subject: Re: [PATCH 167/190] Revert "gdrom: fix a memory leak bug" Message-ID: References: <20210421130105.1226686-168-gregkh@linuxfoundation.org> <23ffd3c5-0095-6a95-8c30-2b6f67377ce7@axentia.se> <14bdfbee-b8b9-d8ac-de34-b6d852d1485b@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14bdfbee-b8b9-d8ac-de34-b6d852d1485b@kernel.dk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 23, 2021 at 08:20:30AM -0600, Jens Axboe wrote: > On 4/22/21 3:29 PM, Peter Rosin wrote: > >> This reverts commit 093c48213ee37c3c3ff1cf5ac1aa2a9d8bc66017. > > > > The reverted patch looks fishy. > > > > gc.cd_info is kzalloc:ed on probe. In case probe fails after this allocation, the > > memory is kfree:d but the variable is NOT zeroed out. > > > > AFAICT, the above leads to a double-free on exit by the added line. > > > > I believe gd.cd_info should be kfree:d on remove instead. > > > > However, might not gc.toc also be kfree:d twice for similar reasons? > > > > I could easily be mistaken. > > >From taking a quick look the other day, that's my conclusion too. I > don't think the patch is correct, but I don't think the surrounding code > is correct right now either. Thanks for the review from both of you, I'll keep this commit in the tree. greg k-h