Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2874194pxb; Mon, 1 Nov 2021 03:43:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTTjXETEX3acnP9Vs4BSJMgLclHY2L/1May5Ib7jSrj8Lb039NKbxq/S/0KJO9amdRkdEs X-Received: by 2002:a17:907:7f2a:: with SMTP id qf42mr32250260ejc.139.1635763388492; Mon, 01 Nov 2021 03:43:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635763388; cv=none; d=google.com; s=arc-20160816; b=UNTKY2uFSNbpw8XzTKjH5aZjBQ67NSE//fPRUqTsSL4V75Q/kSK2IxR9Jyh7V35vPg i7y9KTxNV4BCrcBhsIfZiW/3RRKKHdBOdAe7QpdwH4dGul+tuLS8ViK56aJUDK6QObqn 5/XMFZI8S/5naGUVYohkpL81pSmrQ55jsK54e0iI4qNJHi7DClgpGgzcMyfcX4JUap/k DamgYaivhD7uWcuq4Rwka1QV0kbGFVWgZk5Xe3WHnUZU7sdNqf3VNnqE3X4MZP5itwin ll0Qn4S6wo8YGLp4I3PHQSJBR3HS/33qbm2z+orS2tVmTP/Q/jLsQi8XW/VJk24ORHF7 WdSQ== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=0yNRMy91uWzpVLqngjuJ072kcSyVfPnPyUeqGNc4EY0=; b=lRthEtWBRl48T25rSmUT9UxHVtoWk2ZhXD/gGPaBv3oX8wGthX/xIo5R/V5dG3+EwX sZOKf/0KXZOUZYrEl/n1NExHSIbwlKM9fUW0xWKV9Li1IcOgdC0CVdLrhxPRh99uT7aR B6Ij/wROktQ+6uN2v58OM0qK5IKFpnoPTZ214WE1LkffdUGvqcJEUfD8gM0M3ZFKeafK YGx0Z/81GuFxn1kL2wXAGhpTVsUBSQZrP5tl65fxJZfopQtRiNnMrDFIu88iHg1Rx06i LkILy+vXSJisFDhDu9PtuHDe6JBz9QIRE4TPXZGOtIzJo4gU+nKJ0lixKOv9Si0Z1ssd GmhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=XmxLfBfM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gk1si28917200ejc.780.2021.11.01.03.42.44; Mon, 01 Nov 2021 03:43:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=XmxLfBfM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231952AbhKAKne (ORCPT + 99 others); Mon, 1 Nov 2021 06:43:34 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:43956 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S231560AbhKAKnd (ORCPT ); Mon, 1 Nov 2021 06:43:33 -0400 X-UUID: 66bb92f5f0c74b52954d9f3d793eb446-20211101 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=0yNRMy91uWzpVLqngjuJ072kcSyVfPnPyUeqGNc4EY0=; b=XmxLfBfMTgKVUbsXbSZ52y2ZhsMdHCrO5NS23ZQDEa8JI/mphaIc08rVKsaE/vmTlawY+C8zQltUz9zPR//ZABAZbq2uXvkF+I0ZXBd2LBnBcilDgAZTTIzsxl1lxXDudS7pv82NdmfAq6ic745mnDVh4ksXrAYzQHteZKnr564=; X-UUID: 66bb92f5f0c74b52954d9f3d793eb446-20211101 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 276154276; Mon, 01 Nov 2021 18:40:57 +0800 Received: from mtkmbs10n2.mediatek.inc (172.21.101.183) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Mon, 1 Nov 2021 18:40:56 +0800 Received: from mhfsdcap04 (10.17.3.154) by mtkmbs10n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.3 via Frontend Transport; Mon, 1 Nov 2021 18:40:55 +0800 Message-ID: <45cc8d0e25bdb73d8262f59166cac6ea3c80770b.camel@mediatek.com> Subject: Re: [PATCH] memory: mtk-smi: Fix a null dereference for the ostd From: Yong Wu To: Krzysztof Kozlowski CC: Krzysztof Kozlowski , Joerg Roedel , Will Deacon , Robin Murphy , "Tomasz Figa" , , , , , , , , , , Ikjoon Jang , "Matthias Brugger" Date: Mon, 1 Nov 2021 18:40:53 +0800 In-Reply-To: <82835e3d-11a3-32e4-0782-d827a5e3d78e@canonical.com> References: <20211028055056.26378-1-yong.wu@mediatek.com> <23b036d1-bdc4-da55-a800-03fc3dabd48e@canonical.com> <9e4f327511fd85ba8613ec27644fbc29bc4ddb6b.camel@mediatek.com> <82835e3d-11a3-32e4-0782-d827a5e3d78e@canonical.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 X-MTK: N Content-Transfer-Enco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