From patchwork Wed Oct 16 16:33:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiju Jose X-Patchwork-Id: 11193781 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C60D14DB for ; Wed, 16 Oct 2019 16:34:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5737C21D7A for ; Wed, 16 Oct 2019 16:34:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727054AbfJPQe3 (ORCPT ); Wed, 16 Oct 2019 12:34:29 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:4191 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730251AbfJPQe3 (ORCPT ); Wed, 16 Oct 2019 12:34:29 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id B11D79A0D81127DA638A; Thu, 17 Oct 2019 00:34:26 +0800 (CST) Received: from DESKTOP-6T4S3DQ.china.huawei.com (10.202.226.55) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Thu, 17 Oct 2019 00:34:19 +0800 From: Shiju Jose To: , CC: , Shiju Jose Subject: [PATCH 2/7] rasdaemon: fix memory leak in ras-events.c:handle_ras_events() Date: Wed, 16 Oct 2019 17:33:56 +0100 Message-ID: <20191016163401.16980-3-shiju.jose@huawei.com> X-Mailer: git-send-email 2.19.2.windows.1 In-Reply-To: <20191016163401.16980-1-shiju.jose@huawei.com> References: <20191016163401.16980-1-shiju.jose@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.55] X-CFilter-Loop: Reflected Sender: linux-edac-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org This patch fix memory leak in handle_ras_events() when failed to trace all supported RAS events. Signed-off-by: Shiju Jose --- ras-events.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ras-events.c b/ras-events.c index d1773b1..d543251 100644 --- a/ras-events.c +++ b/ras-events.c @@ -846,7 +846,8 @@ int handle_ras_events(int record_events) if (!num_events) { log(ALL, LOG_INFO, "Failed to trace all supported RAS events. Aborting.\n"); - return EINVAL; + rc = -EINVAL; + goto err; } data = calloc(sizeof(*data), cpus);