Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1153307pxv; Fri, 23 Jul 2021 00:46:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4dVAWPjS1H0Yyxtw5zG10e8NjqgHMI+znNydJI15WQBm32mFmhAdwD+8rjQx0YwEbJNol X-Received: by 2002:a05:6638:130b:: with SMTP id r11mr3049014jad.79.1627026375150; Fri, 23 Jul 2021 00:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627026375; cv=none; d=google.com; s=arc-20160816; b=n1yCCDF/V7wmeR1pA/EaNSF1ujdelBZ0gU7FXt4cS1zgrYpomYK57EQBjco5P0lUaT k8OC/99NWX5XQM2eIxx9Wz8Hj7iGjVWnfXHRDuEYuzOVDNG/YK9B1ZqP2rBcMbY80wf9 ngzjS9OsPSEsxD3dIdowQ5oUfAQ8LMAX9p8fJsm4wMMIXcwfLqho5WVtEUjA7jrCeRNN 6yymUnvdWj/BH02Cth7W1N1qye+a8Ut4H6MPnQm3wrnN8nderRMvF1hZYkEgJeROTx/H QnDHfCzga/5L0yUnWMRqx13bKfZFq64ZjUvq99YvT3REsDOz1JsdV4noGfTWf+CfS87k PFRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=cGv3LznFQj68M3237sMqjjgkGl6aRsKe6S2Fhiqr9Cc=; b=EUhRzlFRd/bqHgi9dseApMqJGMJ1YeM12qkrpzz5/392yGzda/uiIZkNGDblfFJzda chxeSGz0cR0Kcx6+Dq3aIEWy9yCuH2GukTfM8R7EjBv8sBsxo7d53sqxH+dbBfwdIgjr 1Ags1jrVujN4uWbw6N6coiRaYv+tbuNbbPuuWjmgg/UQo1Jikj0JLH1X9AOoLYJIMg5+ B+2NFn6mfV++APIqsCn1ZthH3zQUivvwMED/yYaMRnfsPuQHHBYe/ImN5+aqs/lBxwyE /Q5AQMOaakhEvy/KP9WNv7/MA2c4F8hmbcOHiFh/0cN5REkevK6GKSTQgCNUmOwkKZtR 46uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=KXq+ckZw; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r23si14568665iot.18.2021.07.23.00.46.03; Fri, 23 Jul 2021 00:46:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=KXq+ckZw; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234284AbhGWHDK (ORCPT + 99 others); Fri, 23 Jul 2021 03:03:10 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:55458 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbhGWHCs (ORCPT ); Fri, 23 Jul 2021 03:02:48 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id B232E22618; Fri, 23 Jul 2021 07:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1627026201; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cGv3LznFQj68M3237sMqjjgkGl6aRsKe6S2Fhiqr9Cc=; b=KXq+ckZwyzg6JxoBwZkhZeWN4+N5CE4kZ48rC/vTEZZOirYZ+oYTDwX3grViOOYdseBF2k 4QflnPkAI24e+ogbkiq8qNHivUGojTVhk+Eb3f+ahq7nB+iBtsv4ZNedRA4q2OzJgZ4kIr wYAAUv2j9xoS0m9tiUuz3BcL8TW2LLI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1627026201; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cGv3LznFQj68M3237sMqjjgkGl6aRsKe6S2Fhiqr9Cc=; b=kp8W8zQKNV81u1ForDI3lERrulZrbrxDzAik6MeoD29ITI4X0aSSqJ0Ooy7KKqtRQkSSh/ PZbi/pT5jyacXcCQ== Received: from localhost.localdomain (unknown [10.100.201.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 8A951A3B95; Fri, 23 Jul 2021 07:43:21 +0000 (UTC) From: Jiri Slaby To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby , "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org Subject: [PATCH 8/8] tty: pdc_cons, free tty_driver upon failure Date: Fri, 23 Jul 2021 09:43:17 +0200 Message-Id: <20210723074317.32690-9-jslaby@suse.cz> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210723074317.32690-1-jslaby@suse.cz> References: <20210723074317.32690-1-jslaby@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pdc_console_tty_driver_init() does not free the allocated tty driver in case tty_register_driver() fails. Add one tty_driver_kref_put() to the error path. Signed-off-by: Jiri Slaby Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-parisc@vger.kernel.org --- arch/parisc/kernel/pdc_cons.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c index 70c2a1648fc1..2661cdd256ae 100644 --- a/arch/parisc/kernel/pdc_cons.c +++ b/arch/parisc/kernel/pdc_cons.c @@ -181,6 +181,7 @@ static int __init pdc_console_tty_driver_init(void) if (err) { printk(KERN_ERR "Unable to register the PDC console TTY driver\n"); tty_port_destroy(&tty_port); + tty_driver_kref_put(driver); return err; } -- 2.32.0