From mboxrd@z Thu Jan 1 00:00:00 1970 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 03D07EB64D9 for ; Wed, 14 Jun 2023 07:32:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234764AbjFNHcF (ORCPT ); Wed, 14 Jun 2023 03:32:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234394AbjFNHcE (ORCPT ); Wed, 14 Jun 2023 03:32:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDE08C2 for ; Wed, 14 Jun 2023 00:32:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7213E61B2F for ; Wed, 14 Jun 2023 07:32:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41456C433C0; Wed, 14 Jun 2023 07:32:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1686727921; bh=0fGiFQdMqD6RfLn/ofghzwxIJ1Unihgt4GUULygPToI=; h=Subject:To:From:Date:In-Reply-To:From; b=OPbzVZmqEOwKivD8VT4nR1C3mcVYB+VxHa3zLsYxpeCc4UqeAQO5uT3qLfcC56rXo QO7EuGqzOMwAzCVEn1hw03vnD2mef+J6In4tghqcXQg05cL+bRJV7sXSUX7hvtSobP OKewkxMxArvJ2Wtja+D5FZwDH4z4MBmn6KlJiYSU= Subject: patch "tty: serial: samsung_tty: Fix a memory leak in" added to tty-next To: christophe.jaillet@wanadoo.fr, andi.shyti@kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, krzysztof.kozlowski@linaro.org, stable@vger.kernel.org From: Date: Wed, 14 Jun 2023 09:31:47 +0200 In-Reply-To: Message-ID: <2023061447-error-bobtail-4611@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled tty: serial: samsung_tty: Fix a memory leak in to my tty git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git in the tty-next branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will also be merged in the next major kernel release during the merge window. If you have any questions about this process, please let me know. >From a9c09546e903f1068acfa38e1ee18bded7114b37 Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Sat, 10 Jun 2023 17:59:25 +0200 Subject: tty: serial: samsung_tty: Fix a memory leak in s3c24xx_serial_getclk() in case of error If clk_get_rate() fails, the clk that has just been allocated needs to be freed. Cc: # v3.3+ Reviewed-by: Krzysztof Kozlowski Reviewed-by: Andi Shyti Fixes: 5f5a7a5578c5 ("serial: samsung: switch to clkdev based clock lookup") Signed-off-by: Christophe JAILLET Reviewed-by: Jiri Slaby Message-ID: Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/samsung_tty.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 2a7520ad3abd..a92a23e1964e 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -1459,8 +1459,12 @@ static unsigned int s3c24xx_serial_getclk(struct s3c24xx_uart_port *ourport, continue; rate = clk_get_rate(clk); - if (!rate) + if (!rate) { + dev_err(ourport->port.dev, + "Failed to get clock rate for %s.\n", clkname); + clk_put(clk); continue; + } if (ourport->info->has_divslot) { unsigned long div = rate / req_baud; -- 2.41.0