Hi,

On Tue, Jan 12, 2016 at 12:08:02PM +0200, Cristian Stoica wrote:
> NULL input or output is a valid case and we should not attempt
> to write default values to NULL input or output pointers.
> 
> Signed-off-by: Cristian Stoica <cristian.sto...@nxp.com>
> ---
>  zc.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/zc.c b/zc.c
> index 29b0501..d6adcc4 100644
> --- a/zc.c
> +++ b/zc.c
> @@ -176,9 +176,6 @@ int get_userbuf(struct csession *ses,
>               return 0;
>       }
>  
> -     *src_sg = NULL; /* default to no input */
> -     *dst_sg = NULL; /* default to ignore output */
> -

This does not look correct to me. The purpose of those is to ensure
*src_sg and *dst_sg are initialized. Otherwise if src or dst are NULL
(which matches the situation of "NULL input or output" as you state),
they are left uninitialized by this function.

Do you have an actual use case where this bites you?

Thanks, Phil

_______________________________________________
Cryptodev-linux-devel mailing list
Cryptodev-linux-devel@gna.org
https://mail.gna.org/listinfo/cryptodev-linux-devel

Reply via email to