Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp56916rdb; Thu, 21 Dec 2023 02:42:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFid+bjFPdsJcjS2Mu/0E755dD0m8CLir0QKhycrAa4pt6k+JUzVI6L6010JMj/llmgLCR2 X-Received: by 2002:a50:99da:0:b0:553:4841:9c3e with SMTP id n26-20020a5099da000000b0055348419c3emr3993400edb.55.1703155327154; Thu, 21 Dec 2023 02:42:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703155327; cv=none; d=google.com; s=arc-20160816; b=XReuUrlBI03DRW5yXsnHHAuoxqIsywg72nIi9mQZGNYbpOppWZv7qfkMpLeO203bgA fBj8ergyRcMN3OImvzkw2nUgHawXChIMi23wjsmJELabjibvGoVc3PZrwecujmztG3XP 4ldjPddW62L/rHWWzYZP4QvJWvr9cm/X/M8lY8kA23qduoWzMHt9nf5JaEMUEzwk7NC0 ReW8AvjPq5YwlNQDCVGrz2JVit6Fitx11ICKVTi2Rl2+B44eDe7tFQwrGbm7EuW2Xlqy Ce36xwyZ5KE0APptVNxNHyl5PluIRvMp0JfJ3XF1NO8oNoHN8VpNMautl26+tM6kHSM4 //Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:subject :references:in-reply-to:cc:to:from; bh=27G4fzmVjG3819tFMn/ihMz70kcWMhSE/2KDaIBxL7U=; fh=G22M4A32JAjv0UWq1eA/BSTuo/buM0aFpc9v+q00SWI=; b=Y1GxTqHKKvtJss4B/sL2u/oVHQg0qfAGGsq6lOFUwpoCI08lpJzdtqsAJQSbwF+O0Z bSW2xSRYy3CefD96rXlRI6gRUQVkVieOkYJQ6n3qwg9uvszJPKs9oFHBAGrJ+I9J1qAE u3ScAbCA9tU7FrGLe/K0F4OM+EijYC28zUxlA/yt7MCyJsnMm17VD2lEcPSMWSjy28Nw KZWtTnJ/uHQSRUMPJv8pWj6LS0OZjSjCD5IgesY/L/rmqVEzWc/pNEluZR1/fqalbOFn 0XFwrj6vOMXvaZL0/dTetcuFXDC86PNPTQkuFBKnaUpPsOTKBOIGFiA5W5OhdSV9ZjJH zugw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8222-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q17-20020a50cc91000000b005541c86be34si474208edi.82.2023.12.21.02.42.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 02:42:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-8222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8222-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D5B021F22152 for ; Thu, 21 Dec 2023 10:42:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E8817318E; Thu, 21 Dec 2023 10:40:58 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 504A26EB52 for ; Thu, 21 Dec 2023 10:40:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Swn5Y1gJZz4xM2; Thu, 21 Dec 2023 21:40:49 +1100 (AEDT) From: Michael Ellerman To: npiggin@gmail.com, christophe.leroy@csgroup.eu, ajd@linux.ibm.com, Kunwu Chan Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, mirimmad17@gmail.com, Kunwu Chan In-Reply-To: <20231208085937.107210-1-chentao@kylinos.cn> References: <20231208085937.107210-1-chentao@kylinos.cn> Subject: Re: [PATCH] powerpc/powernv: Add a null pointer check to scom_debug_init_one Message-Id: <170315510016.2192823.2333350776691711493.b4-ty@ellerman.id.au> Date: Thu, 21 Dec 2023 21:38:20 +1100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, 08 Dec 2023 16:59:37 +0800, Kunwu Chan wrote: > kasprintf() returns a pointer to dynamically allocated memory > which can be NULL upon failure. > Add a null pointer check, and release 'ent' to avoid memory leaks. > > Applied to powerpc/next. [1/1] powerpc/powernv: Add a null pointer check to scom_debug_init_one https://git.kernel.org/powerpc/c/9a260f2dd827bbc82cc60eb4f4d8c22707d80742 cheers