From nobody Sun Feb 8 21:53:30 2026 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 01130C001DC for ; Mon, 17 Jul 2023 20:59:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230233AbjGQU7N (ORCPT ); Mon, 17 Jul 2023 16:59:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjGQU7L (ORCPT ); Mon, 17 Jul 2023 16:59:11 -0400 Received: from smtp.smtpout.orange.fr (smtp-17.smtpout.orange.fr [80.12.242.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2C08A4 for ; Mon, 17 Jul 2023 13:59:10 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id LVJCqUVoYFtSYLVJDqOY7F; Mon, 17 Jul 2023 22:59:09 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1689627549; bh=bBwLuFazUuxYCGfEXRFxeHu86Q9tYW1XepWJEFG929I=; h=From:To:Cc:Subject:Date; b=bBnCqgbyiMVdDcTfAiV13KWJ+nMAcHQ4A1fYFzfHrR4flM9hjIb/z63k1uiviOhM6 umJvYXgXrfHZkSoCPKg5b96aLoLFeJnhF2m0q2r9tg5sxWpQpkArXzd+nbUR79ALxV ca1rahGgOJ3CdhL/0n4DLqs1o0UKGdWtc2luHACVxJWbQ3EBjRf0P7yIQXkTkv299I ZY1ATpTB8B8WT86vU8Ne42vutpWSbRU+MhQKEXiCEGtX8sDyiYIouanqZ8yyT2SZBk v3P3R36xMYJ8o4bLAu3iF9h9Vw6cJC/h84RxNyo842mIkyZQeN64qnQopMQni/22m7 /DmDBYCK0Fs4A== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 17 Jul 2023 22:59:09 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Jorge Lopez , Hans de Goede , Mark Gross , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , platform-driver-x86@vger.kernel.org Subject: [PATCH] platform/x86: hp-bioscfg: Fix another memory leaks in hp_populate_enumeration_elements_from_package() Date: Mon, 17 Jul 2023 22:59:05 +0200 Message-Id: <2a60147e2d555a77d348d1bdfec160bc936e1dc6.1689627531.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" If the check that both expected and read object type match fails, some resource may still need to be released. Add the missing kfree(). Fixes: 6b2770bfd6f9 ("platform/x86: hp-bioscfg: enum-attributes") Signed-off-by: Christophe JAILLET --- /!\ Speculative /!\ This patch is based on analysis of the surrounding code and should be reviewed with care ! /!\ Speculative /!\ --- drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c b/drivers= /platform/x86/hp/hp-bioscfg/enum-attributes.c index dd173020c747..8e615ccfc9b5 100644 --- a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c +++ b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c @@ -164,6 +164,7 @@ static int hp_populate_enumeration_elements_from_packag= e(union acpi_object *enum if (expected_enum_types[eloc] !=3D enum_obj[elem].type) { pr_err("Error expected type %d for elem %d, but got type %d instead\n", expected_enum_types[eloc], elem, enum_obj[elem].type); + kfree(str_value); return -EIO; } =20 --=20 2.34.1