From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f199.google.com (mail-io0-f199.google.com [209.85.223.199]) by kanga.kvack.org (Postfix) with ESMTP id 96D836B0292 for ; Thu, 29 Jun 2017 07:19:42 -0400 (EDT) Received: by mail-io0-f199.google.com with SMTP id k2so6771298ioe.4 for ; Thu, 29 Jun 2017 04:19:42 -0700 (PDT) Received: from userp1040.oracle.com (userp1040.oracle.com. [156.151.31.81]) by mx.google.com with ESMTPS id t195si868326ita.14.2017.06.29.04.19.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jun 2017 04:19:41 -0700 (PDT) Date: Thu, 29 Jun 2017 14:19:16 +0300 From: Dan Carpenter Subject: [bug report] percpu: add tracepoint support for percpu memory Message-ID: <20170629110954.uz6he7x25bg4n3pp@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: owner-linux-mm@kvack.org List-ID: To: dennisz@fb.com Cc: linux-mm@kvack.org Hello Dennis Zhou, This is a semi-automatic email about new static checker warnings. The patch df95e795a722: "percpu: add tracepoint support for percpu memory" from Jun 19, 2017, leads to the following Smatch complaint: mm/percpu-km.c:88 pcpu_destroy_chunk() warn: variable dereferenced before check 'chunk' (see line 86) mm/percpu-km.c 85 pcpu_stats_chunk_dealloc(); 86 trace_percpu_destroy_chunk(chunk->base_addr); ^^^^^^^^^^^^^^^^ There should probably be a NULL check here? 87 88 if (chunk && chunk->data) 89 __free_pages(chunk->data, order_base_2(nr_pages)); 90 pcpu_free_chunk(chunk); regards, dan carpenter -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f72.google.com (mail-pg0-f72.google.com [74.125.83.72]) by kanga.kvack.org (Postfix) with ESMTP id 07BC16B02C3 for ; Thu, 29 Jun 2017 10:56:43 -0400 (EDT) Received: by mail-pg0-f72.google.com with SMTP id j186so90549919pge.12 for ; Thu, 29 Jun 2017 07:56:42 -0700 (PDT) Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com. [67.231.145.42]) by mx.google.com with ESMTPS id d22si4167031plj.415.2017.06.29.07.56.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jun 2017 07:56:42 -0700 (PDT) Date: Thu, 29 Jun 2017 10:56:26 -0400 From: Dennis Zhou Subject: [PATCH 1/1] percpu: fix static checker warnings in pcpu_destroy_chunk Message-ID: <20170629145625.GA79969@dennisz-mbp> References: <20170629110954.uz6he7x25bg4n3pp@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20170629110954.uz6he7x25bg4n3pp@mwanda> Sender: owner-linux-mm@kvack.org List-ID: To: Tejun Heo Cc: Dan Carpenter , linux-mm@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb0-f199.google.com (mail-yb0-f199.google.com [209.85.213.199]) by kanga.kvack.org (Postfix) with ESMTP id E06046B0313 for ; Thu, 29 Jun 2017 11:24:16 -0400 (EDT) Received: by mail-yb0-f199.google.com with SMTP id g31so70857325ybe.11 for ; Thu, 29 Jun 2017 08:24:16 -0700 (PDT) Received: from mail-yb0-x235.google.com (mail-yb0-x235.google.com. [2607:f8b0:4002:c09::235]) by mx.google.com with ESMTPS id a66si1469566ybi.188.2017.06.29.08.24.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jun 2017 08:24:15 -0700 (PDT) Received: by mail-yb0-x235.google.com with SMTP id 84so29916209ybe.0 for ; Thu, 29 Jun 2017 08:24:15 -0700 (PDT) Date: Thu, 29 Jun 2017 11:24:13 -0400 From: Tejun Heo Subject: Re: [PATCH 1/1] percpu: fix static checker warnings in pcpu_destroy_chunk Message-ID: <20170629152413.GA9745@htj.duckdns.org> References: <20170629110954.uz6he7x25bg4n3pp@mwanda> <20170629145625.GA79969@dennisz-mbp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170629145625.GA79969@dennisz-mbp> Sender: owner-linux-mm@kvack.org List-ID: To: Dennis Zhou Cc: Dan Carpenter , linux-mm@kvack.org On Thu, Jun 29, 2017 at 10:56:26AM -0400, Dennis Zhou wrote: > From 5021b97f4026334d2c8dfad80797dd1028cddd73 Mon Sep 17 00:00:00 2001 > From: Dennis Zhou > Date: Thu, 29 Jun 2017 07:11:41 -0700 > > Add NULL check in pcpu_destroy_chunk to correct static checker warnings. > > Signed-off-by: Dennis Zhou > Reported-by: Dan Carpenter Applied to percpu/for-4.13. Thanks. -- tejun -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org