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]
Date:   Tue, 23 Aug 2022 15:18:01 -0400
From:   Matthew Rosato <mjrosato@...ux.ibm.com>
To:     linux-s390@...r.kernel.org, frankja@...ux.ibm.com
Cc:     farman@...ux.ibm.com, schnelle@...ux.ibm.com, pmorel@...ux.ibm.com,
        borntraeger@...ux.ibm.com, imbrenda@...ux.ibm.com,
        david@...hat.com, hca@...ux.ibm.com, gor@...ux.ibm.com,
        gerald.schaefer@...ux.ibm.com, agordeev@...ux.ibm.com,
        svens@...ux.ibm.com, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] KVM: s390: pci: fix plain integer as NULL pointer
 warnings

On 8/23/22 3:15 PM, Matthew Rosato wrote:
> Fix some sparse warnings that a plain integer 0 is being used instead of
> NULL.
> 
> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Matthew Rosato <mjrosato@...ux.ibm.com>

@Janosch, since you are taking the other PCI fix can you also take this small cleanup through KVM?

> ---
>  arch/s390/kvm/pci.c | 4 ++--
>  arch/s390/kvm/pci.h | 6 +++---
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/s390/kvm/pci.c b/arch/s390/kvm/pci.c
> index bb8c335d17b9..3c12637ce08c 100644
> --- a/arch/s390/kvm/pci.c
> +++ b/arch/s390/kvm/pci.c
> @@ -58,7 +58,7 @@ static int zpci_setup_aipb(u8 nisc)
>  	if (!zpci_aipb)
>  		return -ENOMEM;
>  
> -	aift->sbv = airq_iv_create(ZPCI_NR_DEVICES, AIRQ_IV_ALLOC, 0);
> +	aift->sbv = airq_iv_create(ZPCI_NR_DEVICES, AIRQ_IV_ALLOC, NULL);
>  	if (!aift->sbv) {
>  		rc = -ENOMEM;
>  		goto free_aipb;
> @@ -373,7 +373,7 @@ static int kvm_s390_pci_aif_disable(struct zpci_dev *zdev, bool force)
>  		gaite->gisc = 0;
>  		gaite->aisbo = 0;
>  		gaite->gisa = 0;
> -		aift->kzdev[zdev->aisb] = 0;
> +		aift->kzdev[zdev->aisb] = NULL;
>  		/* Clear zdev info */
>  		airq_iv_free_bit(aift->sbv, zdev->aisb);
>  		airq_iv_release(zdev->aibv);
> diff --git a/arch/s390/kvm/pci.h b/arch/s390/kvm/pci.h
> index 3a3606c3a0fe..7be5568d8bd2 100644
> --- a/arch/s390/kvm/pci.h
> +++ b/arch/s390/kvm/pci.h
> @@ -46,9 +46,9 @@ extern struct zpci_aift *aift;
>  static inline struct kvm *kvm_s390_pci_si_to_kvm(struct zpci_aift *aift,
>  						 unsigned long si)
>  {
> -	if (!IS_ENABLED(CONFIG_VFIO_PCI_ZDEV_KVM) || aift->kzdev == 0 ||
> -	    aift->kzdev[si] == 0)
> -		return 0;
> +	if (!IS_ENABLED(CONFIG_VFIO_PCI_ZDEV_KVM) || aift->kzdev == NULL ||
> +	    aift->kzdev[si] == NULL)
> +		return NULL;
>  	return aift->kzdev[si]->kvm;
>  };
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ