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 EC8CDC433EF for ; Thu, 3 Mar 2022 07:37:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230179AbiCCHi1 (ORCPT ); Thu, 3 Mar 2022 02:38:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229830AbiCCHiS (ORCPT ); Thu, 3 Mar 2022 02:38:18 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5015B19C0D for ; Wed, 2 Mar 2022 23:37:32 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E51C2B82372 for ; Thu, 3 Mar 2022 07:37:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D27ECC340E9; Thu, 3 Mar 2022 07:37:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646293049; bh=BJkNCZO8VweLQb/iuw+uNcHhYzo/oeyZsonYLCZ0vMs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=asGAnY3yX0TssdtIsJzTeUfBYo5PN8zscaOrtr7l5qJ8d/3+dnAoLJGMNWn24ca8s PAQC47RRmyNnpguBfP8GeW9sV8sXuqWccmGzL77zxk2EJHNe8Y5xzQ0csljbmIS9zZ dU1hGuZATeAAGWxfzxPJrITx5lrfTj3gtrpFzntM= Date: Thu, 3 Mar 2022 08:37:25 +0100 From: Greg KH To: Jianglei Nie Cc: jirislaby@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tty: vt: consolemap: Add missing kfree() in con_do_clear_unimap() Message-ID: References: <20220303020630.460257-1-niejianglei2021@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220303020630.460257-1-niejianglei2021@163.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 03, 2022 at 10:06:30AM +0800, Jianglei Nie wrote: > We should free p after con_release_unimap(p) like the call points of > con_release_unimap() do in the same file. > > This patch adds the missing kfree() after con_release_unimap(p). > > Signed-off-by: Jianglei Nie > --- > drivers/tty/vt/consolemap.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c > index d815ac98b39e..5279c3d27720 100644 > --- a/drivers/tty/vt/consolemap.c > +++ b/drivers/tty/vt/consolemap.c > @@ -520,6 +520,7 @@ static int con_do_clear_unimap(struct vc_data *vc) > p->refcount++; > p->sum = 0; > con_release_unimap(p); > + kfree(p); > } > return 0; > } > -- > 2.25.1 > How did you test this code?