Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp597678pxm; Thu, 3 Mar 2022 00:12:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhYrCEXi8GTevqCaUBI9s/iacgJTKNJzEq0qqFTbrbgPwv4Q40VtuAlCNJKDXbcH3FOeWc X-Received: by 2002:a62:e317:0:b0:4ca:25ee:d633 with SMTP id g23-20020a62e317000000b004ca25eed633mr37005175pfh.23.1646295153146; Thu, 03 Mar 2022 00:12:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646295153; cv=none; d=google.com; s=arc-20160816; b=j6JayYfaIqQMElsrLHS/sOYl8NELQk9N1KOkunJG+In6miS3pEZr+geH2sLn0hB+Ok olwpntMpxC0iFCzcyKiN6cigIDXxOrB21WJA3NUe5Z+hk17XtdcPFIt4qf+tI6rulOni QOe8FKEkQ5LCeYcLBMBM1L4Ai03r4/RVxYRUxweJAu0didj3loWezFR2tVxWOW2vAwpa YNQxPh522Mj/H/GL5sf3Hj2/9yOQRnTfxSwi/E65xL7ksftM+MAo0pQ/BZAFwk7okGSk LrA97DMB4zY9eLKQ27kk0qQ+IAACIpiESfwl+7ov6KartUyqXzTEfFJH5F5vgXRmPh9S LW+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cwEPPz+OE3YdJ9aHYK329m11cx3yA4ZMZFpk+oSlccw=; b=K/lCS60QxxITt34InOU5Png6zGWQW/IKwsbyAaf5ngk5Xj7Vtr2PuAy9mHzXngNHzb Mo8RO9pp2XoqSrkVRxOIxVD2Ti+fozmm/hMhh8N5FrP6ji0aaRZ7L5HvAb0Yc4jN28fO DnYIMNL+tsG8+WBlOSRuED9dVErP5/o4/23VlvSAq3AoTK9/E790k+WpMeL7cvHFCZt3 Nx9nv8bFQ+FnDDMbb5VvnJaiwzePTvAUngxUCB0RVnONGzc89q3xp1BCvh+GeMYlpDvx hVhP9u+LRef7XOVtH/+0uQ5i6E9YHruNJZjp+Iy/ZQDSRd6eH3YvZhYgqzh2yWvIwKdL tE2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=asGAnY3y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f4-20020a056a00238400b004f38de5b73dsi1365281pfc.344.2022.03.03.00.12.17; Thu, 03 Mar 2022 00:12:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=asGAnY3y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230009AbiCCHiZ (ORCPT + 99 others); Thu, 3 Mar 2022 02:38:25 -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> X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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?