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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15C0DC77B70 for ; Mon, 17 Apr 2023 14:42:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:In-Reply-To: Date:References:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=c9n2GzxwoxUdLMn3q5/fS+X12gcAuCpW9EDCJMuscS8=; b=oSdMbz3+et2rqQ rZBMQ7Z8Z2J/jMoN2Hc+yszBm6xGyw705CpRIbpyKFLFNSamJam82vibVzbi5NaWhcod6TlHorjnb or/kN2+HCNyfmau4xR+QMRYI0KN5jj1ORjiq3k42mrHDrT5xlaDuRad7t6UIqy/LadayKKpnxQnkv NvbXfkHa7ox+iGlE1sbj3yu/yALToBV5/rmTn8hhld/4024PLELxMNWv5AMZB/mNnkA7ihJxKdIHu 8OHxXUHgOjnm+9PrSAhnzTMlxGRrd+QsYfurM3fJU2NnsQuiSqPXoYnb+qZavqT4j21enyaZDPJQx rGgxDMhcOPhmlEfp2aYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1poQ4H-00Gftf-1t; Mon, 17 Apr 2023 14:42:57 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1poQ4E-00Gfrw-0N for ath11k@lists.infradead.org; Mon, 17 Apr 2023 14:42:56 +0000 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33HCtV7Z007267; Mon, 17 Apr 2023 14:42:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : references : date : in-reply-to : message-id : mime-version : content-type; s=qcppdkim1; bh=5qzd+c0AETChtvpI0vuLSbl7U7FbPzJnd0FfoOEhIaE=; b=d83kJ4LEVgpDwRbJIfScjM0ci2P9l7VFJg8STkWtX1Vk3RhnMg62DLAte+wcJjjZFwSK hpSsm6R9SirIQawc0FyNmpR2dqj/AfCB+IlEOlukxyt/pHw5VLULAc3tfvUdChjHlC2c ITR9VKacjAJ2zNVsl58jupmLNDC7p45UCZ88Pgr97wkplcGVXEy7dBi30E/iPtowZYUa 7lg9FVQX+mpQKjsyca6+WYXrWD1K5YUmMd3pYM4wwmLs301Jnbc0yCr8D5BiWxb2icOM a50Wbo2dPAZtv0/Zxdy2yUwKnfPQeaZ2POWtcH/iSPuUCwEcKzPnzQwBU45j516VpQsz UQ== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3q11er8y0v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Apr 2023 14:42:51 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 33HEgnI2002301 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Apr 2023 14:42:50 GMT Received: from kvalo10 (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Mon, 17 Apr 2023 07:42:41 -0700 From: Kalle Valo To: Dan Carpenter CC: , , , , Subject: Re: drivers/net/wireless/ath/ath11k/debugfs.c:1009 ath11k_debugfs_soc_create() warn: passing zero to 'PTR_ERR' References: <278dae1d-0cc2-4963-b7f0-5d611a5b31a4@kili.mountain> Date: Mon, 17 Apr 2023 17:42:38 +0300 In-Reply-To: <278dae1d-0cc2-4963-b7f0-5d611a5b31a4@kili.mountain> (Dan Carpenter's message of "Sat, 15 Apr 2023 16:15:07 +0300") Message-ID: <87o7nm4lk1.fsf@kvalo10.eu.qualcomm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: H9A4xvmLo5N9w1APDOkTIhTehPqH1_oK X-Proofpoint-ORIG-GUID: H9A4xvmLo5N9w1APDOkTIhTehPqH1_oK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-17_08,2023-04-17_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 suspectscore=0 priorityscore=1501 mlxscore=0 spamscore=0 mlxlogscore=429 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304170131 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230417_074254_271672_64DDC96A X-CRM114-Status: GOOD ( 16.72 ) X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ath11k" Errors-To: ath11k-bounces+ath11k=archiver.kernel.org@lists.infradead.org + ath11k list Including the full report below. Kalle Dan Carpenter writes: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > head: 7a934f4bd7d6f9da84c8812da3ba42ee10f5778e > commit: 323d91d4684d238f6bc3693fed93caf795378fe0 wifi: ath11k: debugfs: fix to work with multiple PCI devices > config: openrisc-randconfig-m041-20230414 > (https://download.01.org/0day-ci/archive/20230415/202304152142.ssXYxFdQ-lkp@intel.com/config) > compiler: or1k-linux-gcc (GCC) 12.1.0 > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot > | Reported-by: Dan Carpenter > | Link: https://lore.kernel.org/r/202304152142.ssXYxFdQ-lkp@intel.com/ > > New smatch warnings: > drivers/net/wireless/ath/ath11k/debugfs.c:1009 ath11k_debugfs_soc_create() warn: passing zero to 'PTR_ERR' > > Old smatch warnings: > drivers/net/wireless/ath/ath11k/debugfs.c:1022 ath11k_debugfs_soc_create() warn: passing zero to 'PTR_ERR' > > vim +/PTR_ERR +1009 drivers/net/wireless/ath/ath11k/debugfs.c > > cb4e57db2ff0c8 Kalle Valo 2020-09-16 998 int ath11k_debugfs_soc_create(struct ath11k_base *ab) > da3a9d3c15769b Kalle Valo 2020-09-16 999 { > 323d91d4684d23 Kalle Valo 2022-12-22 1000 struct dentry *root; > 323d91d4684d23 Kalle Valo 2022-12-22 1001 bool dput_needed; > 323d91d4684d23 Kalle Valo 2022-12-22 1002 char name[64]; > 323d91d4684d23 Kalle Valo 2022-12-22 1003 int ret; > 323d91d4684d23 Kalle Valo 2022-12-22 1004 > 323d91d4684d23 Kalle Valo 2022-12-22 1005 root = debugfs_lookup("ath11k", NULL); > 323d91d4684d23 Kalle Valo 2022-12-22 1006 if (!root) { > 323d91d4684d23 Kalle Valo 2022-12-22 1007 root = debugfs_create_dir("ath11k", NULL); > 323d91d4684d23 Kalle Valo 2022-12-22 1008 if (IS_ERR_OR_NULL(root)) > 323d91d4684d23 Kalle Valo 2022-12-22 @1009 return PTR_ERR(root); > > Debugfs used to return a mix of error pointers and NULL but we changed > the NULL return to an error pointer to encourage people to just delete > all debugfs error handling code. > > 323d91d4684d23 Kalle Valo 2022-12-22 1010 > 323d91d4684d23 Kalle Valo 2022-12-22 1011 dput_needed = false; > 323d91d4684d23 Kalle Valo 2022-12-22 1012 } else { > 323d91d4684d23 Kalle Valo 2022-12-22 1013 /* a dentry from lookup() > needs dput() after we don't use it */ > 323d91d4684d23 Kalle Valo 2022-12-22 1014 dput_needed = true; > 323d91d4684d23 Kalle Valo 2022-12-22 1015 } > 323d91d4684d23 Kalle Valo 2022-12-22 1016 > 323d91d4684d23 Kalle Valo 2022-12-22 1017 scnprintf(name, sizeof(name), "%s-%s", ath11k_bus_str(ab->hif.bus), > 323d91d4684d23 Kalle Valo 2022-12-22 1018 dev_name(ab->dev)); > da3a9d3c15769b Kalle Valo 2020-09-16 1019 > 323d91d4684d23 Kalle Valo 2022-12-22 1020 ab->debugfs_soc = debugfs_create_dir(name, root); > 323d91d4684d23 Kalle Valo 2022-12-22 1021 if (IS_ERR_OR_NULL(ab->debugfs_soc)) { > 323d91d4684d23 Kalle Valo 2022-12-22 1022 ret = PTR_ERR(ab->debugfs_soc); > 323d91d4684d23 Kalle Valo 2022-12-22 1023 goto out; > 323d91d4684d23 Kalle Valo 2022-12-22 1024 } > 323d91d4684d23 Kalle Valo 2022-12-22 1025 > 323d91d4684d23 Kalle Valo 2022-12-22 1026 ret = 0; > 323d91d4684d23 Kalle Valo 2022-12-22 1027 > 323d91d4684d23 Kalle Valo 2022-12-22 1028 out: > 323d91d4684d23 Kalle Valo 2022-12-22 1029 if (dput_needed) > 323d91d4684d23 Kalle Valo 2022-12-22 1030 dput(root); > 323d91d4684d23 Kalle Valo 2022-12-22 1031 > 323d91d4684d23 Kalle Valo 2022-12-22 1032 return ret; > da3a9d3c15769b Kalle Valo 2020-09-16 1033 } -- ath11k mailing list ath11k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath11k From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2B7C8460; Mon, 17 Apr 2023 14:43:02 +0000 (UTC) Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33HCtV7Z007267; Mon, 17 Apr 2023 14:42:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : references : date : in-reply-to : message-id : mime-version : content-type; s=qcppdkim1; bh=5qzd+c0AETChtvpI0vuLSbl7U7FbPzJnd0FfoOEhIaE=; b=d83kJ4LEVgpDwRbJIfScjM0ci2P9l7VFJg8STkWtX1Vk3RhnMg62DLAte+wcJjjZFwSK hpSsm6R9SirIQawc0FyNmpR2dqj/AfCB+IlEOlukxyt/pHw5VLULAc3tfvUdChjHlC2c ITR9VKacjAJ2zNVsl58jupmLNDC7p45UCZ88Pgr97wkplcGVXEy7dBi30E/iPtowZYUa 7lg9FVQX+mpQKjsyca6+WYXrWD1K5YUmMd3pYM4wwmLs301Jnbc0yCr8D5BiWxb2icOM a50Wbo2dPAZtv0/Zxdy2yUwKnfPQeaZ2POWtcH/iSPuUCwEcKzPnzQwBU45j516VpQsz UQ== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3q11er8y0v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Apr 2023 14:42:51 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 33HEgnI2002301 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Apr 2023 14:42:50 GMT Received: from kvalo10 (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Mon, 17 Apr 2023 07:42:41 -0700 From: Kalle Valo To: Dan Carpenter CC: , , , , Subject: Re: drivers/net/wireless/ath/ath11k/debugfs.c:1009 ath11k_debugfs_soc_create() warn: passing zero to 'PTR_ERR' References: <278dae1d-0cc2-4963-b7f0-5d611a5b31a4@kili.mountain> Date: Mon, 17 Apr 2023 17:42:38 +0300 In-Reply-To: <278dae1d-0cc2-4963-b7f0-5d611a5b31a4@kili.mountain> (Dan Carpenter's message of "Sat, 15 Apr 2023 16:15:07 +0300") Message-ID: <87o7nm4lk1.fsf@kvalo10.eu.qualcomm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Precedence: bulk X-Mailing-List: oe-kbuild@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: H9A4xvmLo5N9w1APDOkTIhTehPqH1_oK X-Proofpoint-ORIG-GUID: H9A4xvmLo5N9w1APDOkTIhTehPqH1_oK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-17_08,2023-04-17_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 suspectscore=0 priorityscore=1501 mlxscore=0 spamscore=0 mlxlogscore=429 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304170131 + ath11k list Including the full report below. Kalle Dan Carpenter writes: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > head: 7a934f4bd7d6f9da84c8812da3ba42ee10f5778e > commit: 323d91d4684d238f6bc3693fed93caf795378fe0 wifi: ath11k: debugfs: fix to work with multiple PCI devices > config: openrisc-randconfig-m041-20230414 > (https://download.01.org/0day-ci/archive/20230415/202304152142.ssXYxFdQ-lkp@intel.com/config) > compiler: or1k-linux-gcc (GCC) 12.1.0 > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot > | Reported-by: Dan Carpenter > | Link: https://lore.kernel.org/r/202304152142.ssXYxFdQ-lkp@intel.com/ > > New smatch warnings: > drivers/net/wireless/ath/ath11k/debugfs.c:1009 ath11k_debugfs_soc_create() warn: passing zero to 'PTR_ERR' > > Old smatch warnings: > drivers/net/wireless/ath/ath11k/debugfs.c:1022 ath11k_debugfs_soc_create() warn: passing zero to 'PTR_ERR' > > vim +/PTR_ERR +1009 drivers/net/wireless/ath/ath11k/debugfs.c > > cb4e57db2ff0c8 Kalle Valo 2020-09-16 998 int ath11k_debugfs_soc_create(struct ath11k_base *ab) > da3a9d3c15769b Kalle Valo 2020-09-16 999 { > 323d91d4684d23 Kalle Valo 2022-12-22 1000 struct dentry *root; > 323d91d4684d23 Kalle Valo 2022-12-22 1001 bool dput_needed; > 323d91d4684d23 Kalle Valo 2022-12-22 1002 char name[64]; > 323d91d4684d23 Kalle Valo 2022-12-22 1003 int ret; > 323d91d4684d23 Kalle Valo 2022-12-22 1004 > 323d91d4684d23 Kalle Valo 2022-12-22 1005 root = debugfs_lookup("ath11k", NULL); > 323d91d4684d23 Kalle Valo 2022-12-22 1006 if (!root) { > 323d91d4684d23 Kalle Valo 2022-12-22 1007 root = debugfs_create_dir("ath11k", NULL); > 323d91d4684d23 Kalle Valo 2022-12-22 1008 if (IS_ERR_OR_NULL(root)) > 323d91d4684d23 Kalle Valo 2022-12-22 @1009 return PTR_ERR(root); > > Debugfs used to return a mix of error pointers and NULL but we changed > the NULL return to an error pointer to encourage people to just delete > all debugfs error handling code. > > 323d91d4684d23 Kalle Valo 2022-12-22 1010 > 323d91d4684d23 Kalle Valo 2022-12-22 1011 dput_needed = false; > 323d91d4684d23 Kalle Valo 2022-12-22 1012 } else { > 323d91d4684d23 Kalle Valo 2022-12-22 1013 /* a dentry from lookup() > needs dput() after we don't use it */ > 323d91d4684d23 Kalle Valo 2022-12-22 1014 dput_needed = true; > 323d91d4684d23 Kalle Valo 2022-12-22 1015 } > 323d91d4684d23 Kalle Valo 2022-12-22 1016 > 323d91d4684d23 Kalle Valo 2022-12-22 1017 scnprintf(name, sizeof(name), "%s-%s", ath11k_bus_str(ab->hif.bus), > 323d91d4684d23 Kalle Valo 2022-12-22 1018 dev_name(ab->dev)); > da3a9d3c15769b Kalle Valo 2020-09-16 1019 > 323d91d4684d23 Kalle Valo 2022-12-22 1020 ab->debugfs_soc = debugfs_create_dir(name, root); > 323d91d4684d23 Kalle Valo 2022-12-22 1021 if (IS_ERR_OR_NULL(ab->debugfs_soc)) { > 323d91d4684d23 Kalle Valo 2022-12-22 1022 ret = PTR_ERR(ab->debugfs_soc); > 323d91d4684d23 Kalle Valo 2022-12-22 1023 goto out; > 323d91d4684d23 Kalle Valo 2022-12-22 1024 } > 323d91d4684d23 Kalle Valo 2022-12-22 1025 > 323d91d4684d23 Kalle Valo 2022-12-22 1026 ret = 0; > 323d91d4684d23 Kalle Valo 2022-12-22 1027 > 323d91d4684d23 Kalle Valo 2022-12-22 1028 out: > 323d91d4684d23 Kalle Valo 2022-12-22 1029 if (dput_needed) > 323d91d4684d23 Kalle Valo 2022-12-22 1030 dput(root); > 323d91d4684d23 Kalle Valo 2022-12-22 1031 > 323d91d4684d23 Kalle Valo 2022-12-22 1032 return ret; > da3a9d3c15769b Kalle Valo 2020-09-16 1033 }