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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 21 Feb 2021 11:19:28 +0100
From:   Lino Sanfilippo <LinoSanfilippo@....de>
To:     Jarkko Sakkinen <jarkko@...nel.org>
Cc:     peterhuewe@....de, jgg@...pe.ca, stefanb@...ux.vnet.ibm.com,
        James.Bottomley@...senpartnership.com, David.Laight@...lab.com,
        linux-integrity@...r.kernel.org, linux-kernel@...r.kernel.org,
        Lino Sanfilippo <l.sanfilippo@...bus.com>,
        stable@...r.kernel.org
Subject: Re: [PATCH v6] tpm: fix reference counting for struct tpm_chip


Hi,

On 19.02.21 at 10:13, Jarkko Sakkinen wrote:

>> +	rc = cdev_device_add(&chip->cdevs, &chip->devs);
>> +	if (rc) {
>> +		dev_err(&chip->devs,
>> +			"unable to cdev_device_add() %s, major %d, minor %d, err=%d\n",
>> +			dev_name(&chip->devs), MAJOR(chip->devs.devt),
>> +			MINOR(chip->devs.devt), rc);
>> +		goto out_put_devs;
>> +	}
>> +
>> +	return 0;
>> +
>> +out_put_devs:
>
> A nit:
>
> 1. You have already del_cdev:
> 2. Here you use a differing convention with out prefix.
>
> I'd suggest that you put err_ to both:
>
> 1. err_del_cdev
> 2. err_put_devs
>
> It's quite coherent what we have already:
>
> linux-tpmdd on  next took 8s
> ❯ git grep "^err_.*" drivers/char/tpm/ |  wc -l
> 17
>


The label del_cdev is indeed a bit inconsistent with the rest of the code.
But AFAICS out_put_devs is not:
1. all labels in tpm2-space.c start with out_
2. there are more hits for out_ across the whole TPM code (i.e. with the same command
you used above I get 31 hits for _out) than for err_.

I suggest to rename del_cdev to something like out_del_cdev or maybe out_cdev which
seems to be even closer to the existing naming scheme for labels.


Regards,
Lino


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ