Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp615763pxj; Thu, 13 May 2021 12:38:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylk5Te1gFfjRl2VTksvydfHb0X+Ng0REkbyb57/W9Qd0KXu5fSPHxMakkH0eelRUIIT5Hc X-Received: by 2002:aa7:dbc9:: with SMTP id v9mr51825863edt.183.1620934738547; Thu, 13 May 2021 12:38:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620934738; cv=none; d=google.com; s=arc-20160816; b=JqAfcpUF8vY7f9VTtjECKaM7d/nZavkXUR/6oYeWgU3skQRcovGUs3FS+mSYxbe+nF cjr/FgfTBcg2n1lUlDIWP/S2z48UlnXLTDcFKLj4/7WywIaArgvW65/eYZCkN7LP3xDR I4n23IX73NhJI/glMcOZn/4a0PAc4UQkATzSAmsC7DD0bXmwtVZA9mwmKIPwTTlHZV8G MsQ6pmgyTxW1jHlwv/XHselNr3RpvRw4/BjRhfWq3hr0vR0ULBHPJkCIspDySpgG2d5b TIEPBx45fEHHV4qTuHPiysZNkt5iy3VTYIxu2G6uudOx3gMQuXW/TNV7bGar4mqL70yc 0kuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=qSk8EdDb1kcRrXdlXtdeQ8jEmZ0tZKCez1hedruhaUg=; b=CF3Wg8mfHLtyxZBqS3fTSdimDZlWxfCSHXhGHFYHsCknsVxp7/bgNb4Qltj35rZixN dZL9IGfx04kN11O2o8Q94ARxr3vPmu4GrrkaePZP0QhldPO+r79C2xxTe93NprEVMg3f IM28G0co4WYA5+Y5lxtUsstTgaa4c5mSOYjhd5LT+FH12EMJ/5+TfsLCwdnEQCaf5Pqw DUJtD2W9v0oVL/qn9ax/ly+lA5ppV8O+rfw8wDfM62k2L8LQJslGFT0PSNK9eZf8mh0k cdYgGZVJIHzfKLxYoiszC8mSLXKuoS1+z+anaQfhgOOuMz2lUr3xaO59f+f5C8DXAKw9 JyxQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c10si3901288edv.407.2021.05.13.12.38.35; Thu, 13 May 2021 12:38:58 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233957AbhEMNaC (ORCPT + 99 others); Thu, 13 May 2021 09:30:02 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2588 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234053AbhEMN3Q (ORCPT ); Thu, 13 May 2021 09:29:16 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Fgspq0bGzzsRJ3; Thu, 13 May 2021 21:25:23 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Thu, 13 May 2021 21:27:53 +0800 From: Qi Liu To: , , CC: , , , Subject: [PATCH 1/3] coresight: core: Fix use of uninitialized pointer Date: Thu, 13 May 2021 21:27:47 +0800 Message-ID: <1620912469-52222-2-git-send-email-liuqi115@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1620912469-52222-1-git-send-email-liuqi115@huawei.com> References: <1620912469-52222-1-git-send-email-liuqi115@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Junhao He Currently the pointer "sink" might be checked before initialized. Fix this by initializing this pointer. Signed-off-by: Junhao He Signed-off-by: Qi Liu --- drivers/hwtracing/coresight/coresight-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index 6c68d34..4ddf3d2 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -608,7 +608,7 @@ static struct coresight_device * coresight_find_enabled_sink(struct coresight_device *csdev) { int i; - struct coresight_device *sink; + struct coresight_device *sink = NULL; if ((csdev->type == CORESIGHT_DEV_TYPE_SINK || csdev->type == CORESIGHT_DEV_TYPE_LINKSINK) && -- 2.7.4