Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4385342pxf; Tue, 30 Mar 2021 06:43:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSpq8hqe82wgkKgKFn5bn2FFHi49hTrXs4nlfXqbJ/2tJV5IqlwEIiI7x5lk+RT0EL6/PT X-Received: by 2002:a05:6402:888:: with SMTP id e8mr33196947edy.51.1617111818796; Tue, 30 Mar 2021 06:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617111818; cv=none; d=google.com; s=arc-20160816; b=iZf+HcQPTgi3ISNH1Z5/0nkKv5m8L9aoKWo7DRpOggZ8+5hYtcAnvxBoB6d5rSQaAW mF6OKq7gE7IwiibIqqXos3++6KRSPtaheklyTQth6k6mrjO7thpvJlh1k+ZZvNSTgqK6 c76J6RGKLJFaCQJmifx6FFkny6dxaKae4kxf2NbOVYWS8NTZqTxGmieydqdZ9fMHPFfa t9aQxK6tTOMA/4L1B5xsCspn+Vo5JrgHOy5r5P1PEYrhDcANMWPV97GFy7aZbJ0I1DLa WTHlB7Ue44QfshHTcFP+4NIVnJRxkAsQdKmffw8EgZuEfa5rzhqbno4oISB5lyYUzFZZ slLQ== 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:subject:cc:to:from:date; bh=g38sbcgezri14VPQOQVngUBS2udxMIRqKxacNtZ8Whw=; b=L5Az+WmT6E2GhZwpf1qLXYz3KiJp92g+f8QmvixrIWD/dun0FNTWYRB+z4OLWPDJrF CNXHCJUhSZB9R+kq4KSoHIDLTQ2xkUrOugXSuf1XA6ylMZES1M5qo0m+ldgENPJkH1Ba Dr+kt+8e9v5f4RvkRX0xgatIyAn9MUE4xPf1JE+aorChiZk5RNUefP2+JaelQFxF0+tk 1XKLcfX8vcEQmJGY451Yqllt2VcUHNQ3vuGAGuDXvD08dI0swQO4vwO8wvIoysVzJKO9 C0Fsd7WaoEUet5oVHuFCiZfoJWcfDPeGjimKXT8ImvTk8F91Hpji9r8FjHh18yGC4wMi InEg== ARC-Authentication-Results: i=1; mx.google.com; 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 y7si15020607edu.114.2021.03.30.06.43.16; Tue, 30 Mar 2021 06:43:38 -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; 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 S232078AbhC3Njx (ORCPT + 99 others); Tue, 30 Mar 2021 09:39:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:33508 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232038AbhC3NjT (ORCPT ); Tue, 30 Mar 2021 09:39:19 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 52AB2619BD; Tue, 30 Mar 2021 13:39:18 +0000 (UTC) Date: Tue, 30 Mar 2021 09:39:16 -0400 From: Steven Rostedt To: Jiapeng Chong Cc: mingo@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ftrace: Modify parameter transfer type Message-ID: <20210330093916.432697c7@gandalf.local.home> In-Reply-To: <1617098546-41010-1-git-send-email-jiapeng.chong@linux.alibaba.com> References: <1617098546-41010-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 Mar 2021 18:02:26 +0800 Jiapeng Chong wrote: > Fix the following whitescan warning: > > "order" is passed to a parameter that cannot be negative. > > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Chong > --- > kernel/trace/ftrace.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c > index b7e29db..bd42e86 100644 > --- a/kernel/trace/ftrace.c > +++ b/kernel/trace/ftrace.c > @@ -6811,7 +6811,7 @@ void ftrace_free_mem(struct module *mod, void *start_ptr, void *end_ptr) > if (!pg->index) { > *last_pg = pg->next; > order = get_count_order(pg->size / ENTRIES_PER_PAGE); > - free_pages((unsigned long)pg->records, order); > + free_pages((unsigned long)pg->records, (unsigned int)order); NAK! This "fix" actually makes the problem worse, and hides a possible bug. -- Steve > ftrace_number_of_pages -= 1 << order; > ftrace_number_of_groups--; > kfree(pg);