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: <f296720-2ed-72c3-3944-7649ba19ae3@linux.intel.com>
Date:   Thu, 23 Nov 2023 13:29:32 +0200 (EET)
From:   Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To:     "David E. Box" <david.e.box@...ux.intel.com>
cc:     LKML <linux-kernel@...r.kernel.org>,
        platform-driver-x86@...r.kernel.org, rajvi.jingar@...ux.intel.com
Subject: Re: [PATCH V5 05/20] platform/x86/intel/vsec: Assign auxdev parent
 by argument

On Wed, 22 Nov 2023, David E. Box wrote:

> Instead of checking for a NULL parent argument in intel_vsec_add_aux() and
> then assigning it to the probed device, remove this check and just pass the
> device in the call. Since this function is exported, return -EINVAL if the
> parent is not specified.
> 
> Signed-off-by: David E. Box <david.e.box@...ux.intel.com>
> ---
> V5 - New patch
> 
>  drivers/platform/x86/intel/vsec.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/platform/x86/intel/vsec.c b/drivers/platform/x86/intel/vsec.c
> index 7dc3650f2757..7a717183c58b 100644
> --- a/drivers/platform/x86/intel/vsec.c
> +++ b/drivers/platform/x86/intel/vsec.c
> @@ -103,6 +103,9 @@ int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,
>  	struct auxiliary_device *auxdev = &intel_vsec_dev->auxdev;
>  	int ret, id;
>  
> +	if (!parent)
> +		return -EINVAL;
> +
>  	mutex_lock(&vsec_ida_lock);
>  	id = ida_alloc(intel_vsec_dev->ida, GFP_KERNEL);
>  	mutex_unlock(&vsec_ida_lock);
> @@ -124,9 +127,6 @@ int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,
>  		return ret;
>  	}
>  
> -	if (!parent)
> -		parent = &pdev->dev;
> -
>  	auxdev->id = id;
>  	auxdev->name = name;
>  	auxdev->dev.parent = parent;
> @@ -212,7 +212,7 @@ static int intel_vsec_add_dev(struct pci_dev *pdev, struct intel_vsec_header *he
>  	 * Pass the ownership of intel_vsec_dev and resource within it to
>  	 * intel_vsec_add_aux()
>  	 */
> -	return intel_vsec_add_aux(pdev, NULL, no_free_ptr(intel_vsec_dev),
> +	return intel_vsec_add_aux(pdev, &pdev->dev, no_free_ptr(intel_vsec_dev),
>  				  intel_vsec_name(header->id));
>  }

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>

-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ