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 X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D205AC4727C for ; Wed, 30 Sep 2020 14:36:19 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 75B55206D4 for ; Wed, 30 Sep 2020 14:36:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RtN9Q1Jc"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="r206f4SZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75B55206D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=QdW7pv69sUeNAUB+qEQLSNd+Eb3FhdtN2yAJiRjZdb0=; b=RtN9Q1JcZeTPeuj7C3w9ejHi4z 9TGX+6ekCN9JptjfANpls1IiGb8eef8fJ46RaKskD0ukMnWDjLWKKAuqPyKYLvJp/AlrU9KPQbrvw ruliwuMAnekx2aa7ZiWU74Zx3SaSFzJ5e/ZACjiKw8LEZwrIJGEazEjhcVmLHKZbtrKLgKwOx8Jqj I51/XdgHzVId53czY4C3YUcYYTc9Mpov/h19uxK8ztBSvUbIfXIBhsTCHAqluxylTo49yHBmqTGW6 hyfG7+FXGta8uin0VlmJTTKBHujQWSUSojKjaYOJ0pvvW+blN0wCiX4DVbx+UZuHAEOJr4IQmZmVx exzrt/hw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNdCA-0007DK-4t; Wed, 30 Sep 2020 14:35:02 +0000 Received: from aserp2120.oracle.com ([141.146.126.78]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNdC6-0007C9-Em for linux-arm-kernel@lists.infradead.org; Wed, 30 Sep 2020 14:34:59 +0000 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08UETfPC081732; Wed, 30 Sep 2020 14:34:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2020-01-29; bh=MT58P/HJbZsAH0iv2KW0sjsaEmtz2GRN9+AtUhGmvho=; b=r206f4SZjuiOvlhcLP9ZwMgZb5osaweIlJgyY1LJkI1gzZQ4EXVSCSrnnLfQSzu8lLzQ 6mV4stDkbfh8SIVbjtlc+6VYlGzMGodzayyGopORpfjczTrE7qd9lqK6ouXuy4HwR/Jn 4JqamPq3RWdpr7kxcl8GSs1/WlsIOfUiCcNZZREcGavl08hDENwPKMVWGa2XwDynsELu uNckiHwQftl734MMUAaUGj1mYpQ9NZNhfS2IIaa0R54gFPGvgFJCQ839iZOvDbKyboHC Z07EEWrgreos5fx+YRdTcsTeqJ9FPmpEtYwHZNQUUKQMwf3wfZ+NEyu6ZX1kXcjwNJQi kg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 33swkm0v27-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 30 Sep 2020 14:34:51 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08UEYmdk081690; Wed, 30 Sep 2020 14:34:50 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 33tfdu18bn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Sep 2020 14:34:50 +0000 Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 08UEYnIP011139; Wed, 30 Sep 2020 14:34:49 GMT Received: from mwanda (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 30 Sep 2020 07:34:48 -0700 Date: Wed, 30 Sep 2020 17:34:44 +0300 From: Dan Carpenter To: robin.murphy@arm.com Subject: [bug report] perf: Add Arm CMN-600 PMU driver Message-ID: <20200930143444.GA651504@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9759 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=901 phishscore=0 adultscore=0 malwarescore=0 spamscore=0 mlxscore=0 bulkscore=0 suspectscore=3 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009300117 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9759 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 phishscore=0 suspectscore=3 mlxlogscore=910 clxscore=1015 priorityscore=1501 impostorscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009300116 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200930_103458_601836_8B405A26 X-CRM114-Status: GOOD ( 15.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Robin Murphy, The patch 0ba64770a2f2: "perf: Add Arm CMN-600 PMU driver" from Sep 18, 2020, leads to the following static checker warning: drivers/perf/arm-cmn.c:1156 arm_cmn_pmu_offline_cpu() error: potential NULL dereference 'cmn'. drivers/perf/arm-cmn.c 1150 static int arm_cmn_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node) 1151 { 1152 struct arm_cmn *cmn; 1153 unsigned int target; 1154 1155 cmn = hlist_entry_safe(node, struct arm_cmn, cpuhp_node); 1156 if (cpu != cmn->cpu) ^^^^^^^^ It doesn't make sense to use hlist_entry_safe() and then dereference "cmn" without checking for NULL. It should either be hlist_entry() or there should be a NULL check. 1157 return 0; 1158 1159 target = cpumask_any_but(cpu_online_mask, cpu); 1160 if (target >= nr_cpu_ids) 1161 return 0; 1162 1163 perf_pmu_migrate_context(&cmn->pmu, cpu, target); 1164 cmn->cpu = target; 1165 return 0; 1166 } regards, dan carpenter _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel