lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YSnme1mfHS/HCguW@infradead.org>
Date:   Sat, 28 Aug 2021 08:32:11 +0100
From:   Christoph Hellwig <hch@...radead.org>
To:     Luis Chamberlain <mcgrof@...nel.org>
Cc:     Christoph Hellwig <hch@...radead.org>, axboe@...nel.dk,
        martin.petersen@...cle.com, jejb@...ux.ibm.com, kbusch@...nel.org,
        sagi@...mberg.me, adrian.hunter@...el.com, beanhuo@...ron.com,
        ulf.hansson@...aro.org, avri.altman@....com, swboyd@...omium.org,
        agk@...hat.com, snitzer@...hat.com, josef@...icpanda.com,
        hare@...e.de, bvanassche@....org, ming.lei@...hat.com,
        linux-scsi@...r.kernel.org, linux-nvme@...ts.infradead.org,
        linux-mmc@...r.kernel.org, dm-devel@...hat.com,
        nbd@...er.debian.org, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 06/10] mmc/core/block: add error handling support for
 add_disk()

On Fri, Aug 27, 2021 at 11:42:36AM -0700, Luis Chamberlain wrote:
> > >  	if (area_type == MMC_BLK_DATA_AREA_MAIN)
> > >  		dev_set_drvdata(&card->dev, md);
> > > -	device_add_disk(md->parent, md->disk, mmc_disk_attr_groups);
> > > +	ret = device_add_disk(md->parent, md->disk, mmc_disk_attr_groups);
> > > +	if (ret)
> > > +		goto out;
> > 
> > This needs to do a blk_cleanup_queue and also te kfree of md.
> 
> If mmc_blk_alloc_parts() fails mmc_blk_remove_req() is called which
> does both for us?

Yes, but only for the main gendisk, and those parts already added to
the list which happens after device_add_disk succeeded.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ