[PATCH] common/qat: fix incorrect size in the parser

Dooley, Brian brian.dooley at intel.com
Wed Feb 19 10:41:45 CET 2025



> -----Original Message-----
> From: Kusztal, ArkadiuszX <arkadiuszx.kusztal at intel.com>
> Sent: Friday 7 February 2025 09:59
> To: dev at dpdk.org
> Cc: gakhil at marvell.com; Dooley, Brian <brian.dooley at intel.com>; Kusztal,
> ArkadiuszX <arkadiuszx.kusztal at intel.com>; stable at dpdk.org
> Subject: [PATCH] common/qat: fix incorrect size in the parser
> 
> The function `strlen` returns the size of the string without a terminating null-
> character, therefore a request to allocate memory space for a parsed argument
> is too small by 1.
> 
> Fixes: 99ab2806687b ("common/qat: isolate parser arguments
> configuration")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal at intel.com>
> ---
>  drivers/common/qat/qat_device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/common/qat/qat_device.c
> b/drivers/common/qat/qat_device.c index bca88fd9bd..746d8a28bb
> 100644
> --- a/drivers/common/qat/qat_device.c
> +++ b/drivers/common/qat/qat_device.c
> @@ -226,7 +226,7 @@ qat_dev_parse_command_line(struct qat_pci_device
> *qat_dev,
>  	if (!devargs)
>  		return 0;
> 
> -	len = strlen(devargs->drv_str);
> +	len = strlen(devargs->drv_str) + 1;
>  	if (len == 0)
>  		return 0;
>  	/* Allocate per-device command line */
> --
> 2.34.1

Acked-by: Brian Dooley <brian.dooley at intel.com>



More information about the stable mailing list