Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B278C433FE for ; Wed, 24 Nov 2021 12:53:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346219AbhKXM4k (ORCPT ); Wed, 24 Nov 2021 07:56:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:60948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346133AbhKXMxI (ORCPT ); Wed, 24 Nov 2021 07:53:08 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C2AE6615A7; Wed, 24 Nov 2021 12:30:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637757047; bh=YM0DiIMisNCnhZyZwScvZKwQzW957iFOBrnBgMrcl28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IYEOwyOUvxHRzyJSifMLPrPI2oMZkLJbzVLvmV0yrF3XDYHFZbCZErURLfyGSUMPY zGN8eWwkFwNbOkSahNnSiE7sUMuifZ3E5wxDepEbPj/WwYupeMzYfS/ltDiS/bev/x e/41aIF3lN+l9iR5oq5iAlQaeufdWLM71p62yWAA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tang Bin , Krzysztof Kozlowski , Herbert Xu Subject: [PATCH 4.19 012/323] crypto: s5p-sss - Add error handling in s5p_aes_probe() Date: Wed, 24 Nov 2021 12:53:22 +0100 Message-Id: <20211124115719.238424816@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115718.822024889@linuxfoundation.org> References: <20211124115718.822024889@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tang Bin commit a472cc0dde3eb057db71c80f102556eeced03805 upstream. The function s5p_aes_probe() does not perform sufficient error checking after executing platform_get_resource(), thus fix it. Fixes: c2afad6c6105 ("crypto: s5p-sss - Add HASH support for Exynos") Cc: Signed-off-by: Tang Bin Reviewed-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/s5p-sss.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -2166,6 +2166,8 @@ static int s5p_aes_probe(struct platform variant = find_s5p_sss_version(pdev); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) + return -EINVAL; /* * Note: HASH and PRNG uses the same registers in secss, avoid