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 PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 23 Sep 2021 10:52:08 +0200 From: Heiko Carstens <hca@...ux.ibm.com> To: Luis Chamberlain <mcgrof@...nel.org> Cc: Gerald Schaefer <gerald.schaefer@...ux.ibm.com>, axboe@...nel.dk, gregkh@...uxfoundation.org, chaitanya.kulkarni@....com, atulgopinathan@...il.com, hare@...e.de, maximlevitsky@...il.com, oakad@...oo.com, ulf.hansson@...aro.org, colin.king@...onical.com, shubhankarvk@...il.com, baijiaju1990@...il.com, trix@...hat.com, dongsheng.yang@...ystack.cn, ceph-devel@...r.kernel.org, miquel.raynal@...tlin.com, richard@....at, vigneshr@...com, sth@...ux.ibm.com, hoeppner@...ux.ibm.com, gor@...ux.ibm.com, borntraeger@...ibm.com, oberpar@...ux.ibm.com, tj@...nel.org, linux-s390@...r.kernel.org, linux-mtd@...ts.infradead.org, linux-mmc@...r.kernel.org, linux-block@...r.kernel.org, linux-kernel@...r.kernel.org Subject: Re: [PATCH 7/9] s390/block/dcssblk: add error handling support for add_disk() On Mon, Sep 13, 2021 at 09:53:14AM -0700, Luis Chamberlain wrote: > On Mon, Sep 06, 2021 at 01:43:46PM +0200, Gerald Schaefer wrote: > > On Fri, 3 Sep 2021 18:46:26 -0700 > > Luis Chamberlain <mcgrof@...nel.org> wrote: > > > > > On Fri, Sep 03, 2021 at 04:08:48PM +0200, Heiko Carstens wrote: > > > > On Thu, Sep 02, 2021 at 10:41:03AM -0700, Luis Chamberlain wrote: > > > > > We never checked for errors on add_disk() as this function > > > > > returned void. Now that this is fixed, use the shiny new > > > > > error handling. > > > > > > > > > > Signed-off-by: Luis Chamberlain <mcgrof@...nel.org> > > > > > --- > > > > > drivers/s390/block/dcssblk.c | 4 +++- > > > > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > > > > > > > diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c > > > > > index 5be3d1c39a78..b0fd5009a12e 100644 > > > > > --- a/drivers/s390/block/dcssblk.c > > > > > +++ b/drivers/s390/block/dcssblk.c > > > > > @@ -696,7 +696,9 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char > > > > > } > > > > > > > > > > get_device(&dev_info->dev); > > > > > - device_add_disk(&dev_info->dev, dev_info->gd, NULL); > > > > > + rc = device_add_disk(&dev_info->dev, dev_info->gd, NULL); > > > > > + if (rc) > > > > > + goto put_dev; > > > > > > > > This looks not correct to me. We seem to have now in case of an error: > > > > > > > > - reference count imbalance (= memory leak) > > > > - dax cleanup is missing > > > > > > Care to provide an alternative? > > > > See patch below: > > Thanks! Will you queue this up on your end or do would you > prefer for me to roll this into my tree and eventually resend > with the rest? Please add the patch to your tree.
Powered by blists - more mailing lists