Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3087792rwb; Mon, 15 Aug 2022 17:49:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR7qcae+F3FeMb2KgN6zkRfD3kRaa/GWRVL4858EQCX7w2zbfV5CnBtyrKN+LTUIbGvcStYF X-Received: by 2002:a17:906:98d4:b0:730:b545:fb5d with SMTP id zd20-20020a17090698d400b00730b545fb5dmr11635472ejb.532.1660610992875; Mon, 15 Aug 2022 17:49:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610992; cv=none; d=google.com; s=arc-20160816; b=rCbvzaIY5T3hxnYVmTGKoSpaSoDomTBx62q38+y63wz0nJjoPlXWz8Iwov03BJuxE6 laFVJ7cX243F7gF7emBjIfGifiAalUMbodC0d1nI1TBM9rN862wgBRmIEjA6tXGBXks9 VhRCq3QJ5iEKyU0fY7ucGvqSMIcI2JHKnx4EH9I9co4/HaBEhv2bIyK9L4AuxFVFZVvV P9pgGMnK0wdYvBJrYqAWHDHxlXhAM4TmM6cj4Tqlxb1fA07VIbFKu38kOk2H/X8fo1u1 eaMXPTbAyyw2F1gOSlpCCo+/oqI+/TjHnxuoAVnxWbYR4kLATiBFVsLQxr8dlU9P7BP4 8mBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EW90OnQqCYw0VwJWLDenfuyI0vpEC2OJd3dDJu03/jo=; b=UvJINy8bJ5ZTD3u1BpnIBao8iM73xkR/jHLYC1I8/a5rZL6q7s0LRKZozy2ozLt1G4 5TjaGg81mgimkRPpu3AcnCctt4vmmS+hTg9HOOXW8RWiYL2Bf2L+yw20Bc6bkbn0uQjt w/5PwilJq0gfFVbTWhn0tKyZc3AublaGv5GlTany3hbca0FOC6XgIYmmufWcuvg1WL7i Whxjl6i04ZCSCSBIsC+yi5HfJKj8tRjxb9sJnjJX+VpswC9MzHFH3QxoP/IvcocpFxHp FX3ENL+e6opcbyoGLzoLcULnLgNwz5RDskYjnOOJ67jcn19l717ptHWLk2ornQwVYyU2 YVWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j22rfsS4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u8-20020a50eac8000000b0043e6a16bca1si8444359edp.475.2022.08.15.17.49.27; Mon, 15 Aug 2022 17:49:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j22rfsS4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347365AbiHOXbK (ORCPT + 99 others); Mon, 15 Aug 2022 19:31:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245313AbiHOXZk (ORCPT ); Mon, 15 Aug 2022 19:25:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C592BA158; Mon, 15 Aug 2022 13:06:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B26E4B80EA8; Mon, 15 Aug 2022 20:06:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1AEDC433D6; Mon, 15 Aug 2022 20:05:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593959; bh=+83nn2Vmra04i9vGT7jKTSovy3N5iVDyO+3QwXpaetQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j22rfsS4EHktNElLY1/DHBQFpMAcoDvK5CwF/ysnPRMLDdQKXZeAszgOfIHlyR0sA fPcc2naNqnUNTDk8c9f8BPD2E24a/GHfL5ZsmXBznfhnhRDy9cFswya0uhBhjWwayN yjMGU5TLRBB0ku6CQ34MhXiJIalQo6QX2OR/mxS4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Wu , Hulk Robot , Herbert Xu , Sasha Levin Subject: [PATCH 5.19 0354/1157] crypto: sun8i-ss - fix a NULL vs IS_ERR() check in sun8i_ss_hashkey Date: Mon, 15 Aug 2022 19:55:10 +0200 Message-Id: <20220815180453.869574638@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Wu [ Upstream commit 7e8df1fc2d669d04c1f8a9e2d61d7afba1b43df4 ] The crypto_alloc_shash() function never returns NULL. It returns error pointers. Fixes: 801b7d572c0a ("crypto: sun8i-ss - add hmac(sha1)") Signed-off-by: Peng Wu Reported-by: Hulk Robot Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c index 845019bd9591..36a82b22953c 100644 --- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c +++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c @@ -30,8 +30,8 @@ static int sun8i_ss_hashkey(struct sun8i_ss_hash_tfm_ctx *tfmctx, const u8 *key, int ret = 0; xtfm = crypto_alloc_shash("sha1", 0, CRYPTO_ALG_NEED_FALLBACK); - if (!xtfm) - return -ENOMEM; + if (IS_ERR(xtfm)) + return PTR_ERR(xtfm); len = sizeof(*sdesc) + crypto_shash_descsize(xtfm); sdesc = kmalloc(len, GFP_KERNEL); -- 2.35.1