From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A6236882B for ; Fri, 10 Mar 2023 15:05:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09C3DC433D2; Fri, 10 Mar 2023 15:05:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678460755; bh=9VOc0mhSqhqmXrxo7YEm+8Zeipgg+26k82nRhbO1Uiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0Z/nnN0jb4ah1re6LkidW9MHl8FCB9FhkK//E+56QmDynLyVlkT/6WqDNM/UKr+k5 nSNZzj1edF+RIyf3EQYIjRml5ca0U+84dT0zopcNDQTYco1VKqL0+yc3zx8nYVSjS7 phRf5KExtLaL+sMTwSvF9w3bb83JNudvTdNsqrIA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Xiang Yang , Anton Ivanov , Richard Weinberger , Sasha Levin Subject: [PATCH 5.10 439/529] um: vector: Fix memory leak in vector_config Date: Fri, 10 Mar 2023 14:39:42 +0100 Message-Id: <20230310133825.270234246@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133804.978589368@linuxfoundation.org> References: <20230310133804.978589368@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Xiang Yang [ Upstream commit 8f88c73afe481f93d40801596927e8c0047b6d96 ] If the return value of the uml_parse_vector_ifspec function is NULL, we should call kfree(params) to prevent memory leak. Fixes: 49da7e64f33e ("High Performance UML Vector Network Driver") Signed-off-by: Xiang Yang Acked-By: Anton Ivanov Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- arch/um/drivers/vector_kern.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c index 555203e3e7b45..fc662f7cc2afb 100644 --- a/arch/um/drivers/vector_kern.c +++ b/arch/um/drivers/vector_kern.c @@ -771,6 +771,7 @@ static int vector_config(char *str, char **error_out) if (parsed == NULL) { *error_out = "vector_config failed to parse parameters"; + kfree(params); return -EINVAL; } -- 2.39.2