Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp949697pxb; Wed, 6 Apr 2022 05:07:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8wFXB2+ddKwV4muUu8/mPwdFOM7c5Jkwd+feeWydXheSc4uitAgCOVPG3WstxdogBX4tB X-Received: by 2002:a17:902:b941:b0:14d:af72:3f23 with SMTP id h1-20020a170902b94100b0014daf723f23mr8360578pls.6.1649246848749; Wed, 06 Apr 2022 05:07:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649246848; cv=none; d=google.com; s=arc-20160816; b=fEbu0dlNflXsiVJk+foPFv0K41mXlHmhlog2qeA/KzpJLLP1hldepR8dXLszJqqMQF cJ0o8KgJ9Xp2t8yvhFqiLMKbaikoPq5Hi4XhZobGmsFIG5il8Ieog4KOE/GB6A2EFX0P LG9X0HoHjrKJUvuPGe3G67lbKpJUwm0WW83AcVE9DcHb3erOK9vIyfOGbLFWX9hALKxY uWLujGJH6Fatu5QXuqUkdVW39S/5QdvLkIKvU/8Cb8qAv2SvgiryQNiaBguX3SURr8Mo F47U1gRwp4hc6kX7i+5E45CZzmpwfTHXfW/olDO4+2H2790lqKl1XG5cF8S2kxm6ghEh +AbA== 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=liPrx1REbfMicgdj9xPOffYeXIm5k3y8ks2+2twLWNQ=; b=zIX/L3gTonPjvQKgVqD8fsNl2zQol2VXAt0Ztuo+RPH55OHSAso9XmCNBO9R/LcMIT 3QSMCTMRWrYGY6a9eLtSUuDHtrL/G43WxhAC9vGvD6Iy168VQreJjVr8wK7FRcFHQX6l i29NGKFZzZLKkILiS1bhgc8tTekoUF7c0TFpHawjle3u+jmoDdDqh6ytttk1vLzGgAIx YXX4RpRLnxCIoGcZGCedshLWTfMBsF4yPHWrr6B8tLNWkMi/lVRbmxusxa/hyca9HuK8 gotZ05jvaY7IHXIsBUoh9Uaf8yy5Bmt14TVfTGEya7dl7zA/OI7LNznAMtrKzg3Lkdox H3/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uq+Trpb0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z7-20020a170902ccc700b00153b2d16574si15772017ple.380.2022.04.06.05.07.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:07:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uq+Trpb0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C227D68EA6E; Wed, 6 Apr 2022 03:38:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344921AbiDEVIv (ORCPT + 99 others); Tue, 5 Apr 2022 17:08:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348462AbiDEJrr (ORCPT ); Tue, 5 Apr 2022 05:47:47 -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 C8AA113F38; Tue, 5 Apr 2022 02:33:57 -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 61EF4B81C82; Tue, 5 Apr 2022 09:33:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEBBEC385A0; Tue, 5 Apr 2022 09:33:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151235; bh=Qc5JUQdNaG632zqHws9pZ7Yz8zs6uc92MCr5DjfyIrU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uq+Trpb0tW6yiLOxThaAXSpINp4ft7J0JUSSndqMr9SWlTMgY0zwXK2VEv6D8ieEM dlQHuDSxwF4m5Bb4IIy+5NGO60h7yPCqH2nXOkLaiw7Vnw6uluXmT8b3qOiXwJeI3n fPtG/wH1EM1y1HwRtTbfmt0yvdGAZ+VCFJAAzvKA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jia-Ju Bai , Krzysztof Kozlowski , Sasha Levin Subject: [PATCH 5.15 343/913] memory: emif: check the pointer temp in get_device_details() Date: Tue, 5 Apr 2022 09:23:25 +0200 Message-Id: <20220405070350.128361318@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: Jia-Ju Bai [ Upstream commit 5b5ab1bfa1898c6d52936a57c25c5ceba2cb2f87 ] The pointer temp is allocated by devm_kzalloc(), so it should be checked for error handling. Fixes: 7ec944538dde ("memory: emif: add basic infrastructure for EMIF driver") Signed-off-by: Jia-Ju Bai Link: https://lore.kernel.org/r/20220225132552.27894-1-baijiaju1990@gmail.com Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sasha Levin --- drivers/memory/emif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c index d4d4044e05b3..ecc78d6f89ed 100644 --- a/drivers/memory/emif.c +++ b/drivers/memory/emif.c @@ -1025,7 +1025,7 @@ static struct emif_data *__init_or_module get_device_details( temp = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL); dev_info = devm_kzalloc(dev, sizeof(*dev_info), GFP_KERNEL); - if (!emif || !pd || !dev_info) { + if (!emif || !temp || !dev_info) { dev_err(dev, "%s:%d: allocation error\n", __func__, __LINE__); goto error; } -- 2.34.1