From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 17C7FA0A0E for ; Fri, 14 May 2021 09:50:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05137410EE; Fri, 14 May 2021 09:50:09 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id C8BE740042 for ; Fri, 14 May 2021 09:50:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620978606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RtqILjYYAN76rQoxeaTY3PhnJPVTO6PEUpH/h4uGdS8=; b=Z1Aa7a6BJiMSVSi7hw5l9byUNhpD5M8cTDTFhgxAY+hb7oK/U/Q+07YpYHgCqMOhEuKk0G QWMTzx/+aziIEQ0xDsG3j79hfDzKh5BtN5zxKBsSy5sbKxsIj8TTxIA9nqvpqlMCsmbP42 2YLoN+3wC/1Lj4I/tCo+7xhljSWCebM= Received: from mail-ua1-f70.google.com (mail-ua1-f70.google.com [209.85.222.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-113-HzB4FrP9OLWTeoryw2qCeA-1; Fri, 14 May 2021 03:50:03 -0400 X-MC-Unique: HzB4FrP9OLWTeoryw2qCeA-1 Received: by mail-ua1-f70.google.com with SMTP id v6-20020ab020060000b029020b473dd428so3435849uak.16 for ; Fri, 14 May 2021 00:50:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=RtqILjYYAN76rQoxeaTY3PhnJPVTO6PEUpH/h4uGdS8=; b=g2P0TrDVO8hztO5q3ZZwi1/1dYN0Jm2qrooIi68q+htY8gw0b5YmgEZG9abA+mdACa e4bITaF91HuE4UwTliBjCBpHFn4J4MOcpbCPMjQXmmJbfTBqqWbsrVT/dyfBZ+65AsQw 9Iao8S/vyKPdPr56idTCAQxCRA6HOiDpid9oyiaZIC/0BE/TbNmelX16jVJrvd3OVZ3r 0Pjtd8sF0o18EzOFczGvnG9T63LWrnog2nkY5Uw9eI3JjzTTxaaleRT9hUIAAJlO1n4V xLtrzYPQzSCYiZAUZ/mEDJbGLFyCnMjQyE3gf+VBiEV58mz7pSAnQ+gy7zRxD+QRzoN7 kn1w== X-Gm-Message-State: AOAM533rmUsYlL5XDIUXXJnB/TJp2jFvKVM9uyqL48so/6fb9HjMyFpd +C6cusb/b0vl+J6HROqcyXcq0M0D5CXXC4HYvWValn7E1vvB6Y/zX2tSGazSHOyakr+Y2LWPIaS 3xmDu3BMAwfAs4YC+Ry5cX/M= X-Received: by 2002:ab0:132a:: with SMTP id g39mr11070019uae.53.1620978603129; Fri, 14 May 2021 00:50:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNwa1Fu5ptWvCLmY8j9gtYyVvz3ytscIYrsWUrxeNF7QMWzPQbUT22BUsA1Yw45U5FLo7GYC1NE39lsyN1aNI= X-Received: by 2002:ab0:132a:: with SMTP id g39mr11069999uae.53.1620978602980; Fri, 14 May 2021 00:50:02 -0700 (PDT) MIME-Version: 1.0 References: <20210514074113.2666225-1-feifei.wang2@arm.com> In-Reply-To: <20210514074113.2666225-1-feifei.wang2@arm.com> From: David Marchand Date: Fri, 14 May 2021 09:49:51 +0200 Message-ID: To: Feifei Wang Cc: John Griffin , Fiona Trahe , Deepak Kumar Jain , Herbert Guan , Jerin Jacob , dev , nd , dpdk stable , Ruifeng Wang Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-stable] [PATCH] crypto/qat: fix uninitilized compiler warning X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Fri, May 14, 2021 at 9:41 AM Feifei Wang wrote: > > In Arm platform, when "RTE_ARCH_ARM64_MEMCPY" is set as true, compiler > will report variable uninitilized warning: > > ../drivers/crypto/qat/qat_sym_session.c: In function =E2=80=98partial_has= h_compute=E2=80=99: > ../lib/eal/include/generic/rte_byteorder.h:241:24: warning: > =E2=80=98=E2=80=99 may be used uninitialized in this function > [-Wmaybe-uninitialized] > 241 | #define rte_bswap32(x) __builtin_bswap32(x) > ... > > This is because "digest" will be initialized by "rte_memcpy" function > rather than "memcpy" if "RTE_ARCH_ARM64_MEMCPY" is set as true. However, > compiler cannot know it is initialized by the function. > > To fix this, use "calloc" to initialize "digest". > > Fixes: cd7fc8a84b48 ("eal/arm64: optimize memcpy") > Cc: stable@dpdk.org > > Signed-off-by: Feifei Wang > Reviewed-by: Ruifeng Wang > --- > drivers/crypto/qat/qat_sym_session.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qa= t_sym_session.c > index 231b1640da..dab23a3290 100644 > --- a/drivers/crypto/qat/qat_sym_session.c > +++ b/drivers/crypto/qat/qat_sym_session.c > @@ -1190,8 +1190,8 @@ static int partial_hash_compute(enum icp_qat_hw_aut= h_algo hash_alg, > uint8_t *data_out) > { > int digest_size; > - uint8_t digest[qat_hash_get_digest_size( > - ICP_QAT_HW_AUTH_ALGO_DELIMITER)]; > + uint8_t *digest =3D (uint8_t *)calloc(qat_hash_get_digest_size( > + ICP_QAT_HW_AUTH_ALGO_DELIMITER), sizeof(u= int8_t)); calloc can fail. cast is unneded. A simple uint8_t digest[...] =3D { 0 } would do the job. > uint32_t *hash_state_out_be32; > uint64_t *hash_state_out_be64; > int i; > -- > 2.25.1 > --=20 David Marchand