[PATCH v3 04/25] dma/idxd: clear device at scan

Bruce Richardson bruce.richardson at intel.com
Tue May 26 11:41:22 CEST 2026


On Tue, May 26, 2026 at 10:41:44AM +0200, David Marchand wrote:
> Currently, the device object is only manipulated by the dma/idxd bus
> callbacks and EAL is not looking too much into this object.
> 
> However, in the next refactoring, EAL will expect a clean object, like
> when checking that the device has been already probed
> (iow dev->driver != NULL).
> 
> Request a 0'd object when allocating.
> 
> Reported-by: Bruce Richardson <bruce.richardson at intel.com>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---

Acked-by: Bruce Richardson <bruce.richardson at intel.com>


>  drivers/dma/idxd/idxd_bus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/idxd/idxd_bus.c b/drivers/dma/idxd/idxd_bus.c
> index 291cd6c707..f267c20a59 100644
> --- a/drivers/dma/idxd/idxd_bus.c
> +++ b/drivers/dma/idxd/idxd_bus.c
> @@ -322,7 +322,7 @@ dsa_scan(void)
>  		}
>  		IDXD_PMD_DEBUG("%s(): found %s/%s", __func__, path, wq->d_name);
>  
> -		dev = malloc(sizeof(*dev));
> +		dev = calloc(1, sizeof(*dev));
>  		if (dev == NULL) {
>  			closedir(dev_dir);
>  			return -ENOMEM;
> -- 
> 2.53.0
> 


More information about the dev mailing list