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=-3.7 required=3.0 tests=BAYES_00,BIGNUM_EMAILS, 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 0C515C433FE for ; Mon, 7 Dec 2020 17:58:28 +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 BB034235F8 for ; Mon, 7 Dec 2020 17:58:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB034235F8 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=p6/JhiPF8Ff5Lt2oOUIrP3PNEsi7QPEOPAndzzhilAA=; b=giTsqWPpy1atWxN9Pwui8V3can NttG8mt0hFES2Lmv/tpyYWO1fnOA5IxadtjhP90Wzc/6ZiBwRfVZDVC79Qu4w42Ub9ccQvX352dhx U+Aynh2hZ9qNcJPWzNzkfH1tYZxNK1a6/iWh/T8n+dNSaaOdzECtvXIwMBZs5L1piZHp0KID7ujhn VQ5LHhlq7FFx6qLT66GOAvPZlppf7UzkBPHmEAq12G3zu0C+GKf6NSGzBph9cS8wIZFHunt5wTBqr AGdSXwwM9UJAU6mkNosNt0Jxd3+X6XBZQJzYqUndrw4ETWdSeiAhG9mpHOlpbgEMxizLQYUKUAqMq QwtH7JaQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmKlA-0005Ak-BE; Mon, 07 Dec 2020 17:57:16 +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 1kmKl7-0005AG-1U for linux-arm-kernel@lists.infradead.org; Mon, 07 Dec 2020 17:57:14 +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 0B7HtE3w124325; Mon, 7 Dec 2020 17:57:11 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=gIwzM4yhfYnSVLUV9UOQ5Mv9WnP6EFc/1IVGjTWwj18=; b=GHlw1MTCHWEubU6xkr9dDtbJlxNZE6O7pZm6a/7vR+gvHufrBaVX8ZC95EZOcMi1Zrr2 CwDxqx6j0rpRMDjGbcbWWU8UJc8RAk6D6VjEzHTqAZSAzsgP0+eOcz5rXBA7/9634JyX BKy95oUH7YdMGptDGVuG0sXOscYDKfPIKMXPc1tCcWT7HYfUb1UhURliTmxAKRoqBema x1itknJSVhJzULdxrJgH6sHdIiRNPff/Z54lGx+s+YSkF2mYyZJb8FVjoo6oECMxPCK+ VVLbjYZBUucUCN07XQKMSSZTdELrm5YCeensl1cwsmNmhszPRYeAna0c5BzDYLU8ovXO kw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 35825kxprr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 07 Dec 2020 17:57:11 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0B7HsSTh126069; Mon, 7 Dec 2020 17:57:11 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 358m3wpeee-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Dec 2020 17:57:11 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 0B7HvAse028692; Mon, 7 Dec 2020 17:57:10 GMT Received: from mwanda (/102.36.221.92) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 07 Dec 2020 09:57:09 -0800 Date: Mon, 7 Dec 2020 20:56:48 +0300 From: Dan Carpenter To: tuanphan@os.amperecomputing.com Subject: [bug report] driver/perf: Add PMU driver for the ARM DMC-620 memory controller Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9828 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 adultscore=0 bulkscore=0 phishscore=0 suspectscore=3 mlxscore=0 mlxlogscore=847 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012070116 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9828 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 adultscore=0 bulkscore=0 phishscore=0 mlxlogscore=837 clxscore=1011 priorityscore=1501 mlxscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012070116 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201207_125713_187222_F098728F X-CRM114-Status: GOOD ( 16.15 ) 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 Tuan Phan, The patch 53c218da220c: "driver/perf: Add PMU driver for the ARM DMC-620 memory controller" from Nov 4, 2020, leads to the following static checker warning: drivers/perf/arm_dmc620_pmu.c:612 dmc620_pmu_cpu_teardown() error: potential NULL dereference 'irq'. drivers/perf/arm_dmc620_pmu.c 604 static int dmc620_pmu_cpu_teardown(unsigned int cpu, 605 struct hlist_node *node) 606 { 607 struct dmc620_pmu_irq *irq; 608 struct dmc620_pmu *dmc620_pmu; 609 unsigned int target; 610 611 irq = hlist_entry_safe(node, struct dmc620_pmu_irq, node); 612 if (cpu != irq->cpu) There isn't any point to using hlist_entry_safe() instead of hlist_entry() when we're not going to check for NULL returns. 613 return 0; 614 615 target = cpumask_any_but(cpu_online_mask, cpu); 616 if (target >= nr_cpu_ids) 617 return 0; 618 619 /* We're only reading, but this isn't the place to be involving RCU */ 620 mutex_lock(&dmc620_pmu_irqs_lock); 621 list_for_each_entry(dmc620_pmu, &irq->pmus_node, pmus_node) 622 perf_pmu_migrate_context(&dmc620_pmu->pmu, irq->cpu, target); 623 mutex_unlock(&dmc620_pmu_irqs_lock); regards, dan carpenter _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel