Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2848503pxb; Mon, 18 Oct 2021 03:15:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/DSDJ40UIj4/i7TzloWK3EKEmCwuMvHIHZ8xa143SlRmgDSLGbH8VKibX/87C2UCY/u3z X-Received: by 2002:a17:902:9007:b0:13d:e735:443e with SMTP id a7-20020a170902900700b0013de735443emr26567513plp.74.1634552139660; Mon, 18 Oct 2021 03:15:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634552139; cv=none; d=google.com; s=arc-20160816; b=09KK3IXpxkS1FvnZL3YpGodZO2GOUGnXZ4y3vaHLizlTHG93xGbJSrBrWy8bjf6+dV J3zcziVxmsH8XncHkUNki1PbyoYoUGsw6hC8Ddt1ynL8R06iZPnlU2ZEszsNdNV0gx7Y Z/K0YKq9AIwvS/agQvf4J+STqAHh7oAMJ0xYNVNuv5aMjONz0ZbXNJc0L4uyivcZ6bxD URxrnXZ9IzD+0Fte9J+18JLVff4YHJ+tw2hMFQqdF+8VJp4plzwGMNn3ZnKSc1/+bJgz GPMtDjw7Lm2xsr+4766q901/RqtyIPzMVgKtQXXaQi+yx8XfY7C8Ht+buzw3km+6QiZ2 sP5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=na9XdlaOtinyDre87NrS9/qbwNynhJfEeSApceSsDl0=; b=JdAghu9HzGFlvWNb9ZimoHUNaIZYVgZuqHO2vtD7HlUEpRxVz2Uyl1aVx46MKyHFRc f64R9VtqzB6GrCCM/I6Qr0CpMDgrY+odGxjLtpkWdrYne6bxuq/SNRzZNNfU27koPzzg 8fzAg6LMtWVohXZi29fqXvl8l0t40Mn/px1G2rhpqRIw++J21LVMdr+aAjebhQvv3pwp GOqKkqFnjsAQ+xcsRdY0Y1MI+zZfI3EHDolIc7cZl56A3Gj5yVdvBZ75i/fwAnKIZ+D+ rwZnT9YnLDyoPzNR6np9BJk5uB9ok9ne9VHBKhpj86c4n+fa93HjONSj7Ki0Ufqsog0Y YVSg== 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 24si22454363pgy.545.2021.10.18.03.15.26; Mon, 18 Oct 2021 03:15:39 -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 S231889AbhJRKQk (ORCPT + 99 others); Mon, 18 Oct 2021 06:16:40 -0400 Received: from verein.lst.de ([213.95.11.211]:33175 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231907AbhJRKPD (ORCPT ); Mon, 18 Oct 2021 06:15:03 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 39B2068AFE; Mon, 18 Oct 2021 12:12:50 +0200 (CEST) Date: Mon, 18 Oct 2021 12:12:50 +0200 From: Christoph Hellwig To: Zqiang Cc: axboe@kernel.dk, hch@lst.de, willy@infradead.org, sunhao.th@gmail.com, hch@infradead.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] block: fix incorrect references to disk objects Message-ID: <20211018101250.GA6754@lst.de> References: <20211018091116.16874-1-qiang.zhang1211@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211018091116.16874-1-qiang.zhang1211@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 18, 2021 at 05:11:16PM +0800, Zqiang wrote: > --- a/block/partitions/core.c > +++ b/block/partitions/core.c > @@ -424,6 +424,7 @@ static struct block_device *add_partition(struct gendisk *disk, int partno, > device_del(pdev); > out_put: > put_device(pdev); > + disk = NULL; > out_put_disk: > put_disk(disk); > return ERR_PTR(err); Stylistic nitpick: I think directly returning where this currently clears disk would be a little easier to follow.