Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp381671ybt; Fri, 26 Jun 2020 01:35:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOppGWrSlzOs7ZnsCXGl9wapuh/LMn4kq5198llyCyWYy8S9Ihq3QAl3GP22ZgTWN6E3eU X-Received: by 2002:aa7:c496:: with SMTP id m22mr2257213edq.187.1593160541856; Fri, 26 Jun 2020 01:35:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593160541; cv=none; d=google.com; s=arc-20160816; b=stUG2wiGLgrmLRecWTO+6/7WmbW+oz7u4N565hh+j977S9eOKNVd78lCN0jiiQC/U1 DK5vvt2VErzrwzsz3h9wREGJmLmahA8AqHS/3Y6emRBIUU49k+hPJtow9tlywawTOUrE imICxkcHnSXWA5vfn2+wAXMuu38hF8llEN5HcPD1aP42hNxvrQh957KxU8H7s2bbPRm5 Zmg1TCE+KlaYBFZBwRZLLpFBvQCwT1/137vBUQ5O5ohzfsHSrBRUVtW5KTJW+GZXR43S uePmxfqV3CBcMwW8KjilIM3APcDRbZ66BVKz5xgkAHk6hHj6esoCJEvrI8l9ULtenC+h 9HpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fjqGH22vN8tmHJC5Ez+rpYalehtYxTKAP/PTFFOVU+A=; b=YKzsuQNEnGSzTmqu8bzpTUkf1WesQvWy7pjiTZfI4lyz+a5RYK95Um0Qnc1z72Mfzh uyE7eP3uJWEu9nQwwGw0njG3XPH7W/EvUi4yFrOdDqGlbfC6HiYwG8LA998uICopLD/i nXr+HaDGAME2HFGAests36atKOA+HoB7hRXAKSUmekT6Wefav92FF3Ias/1UQSO1asla haZ3majzuwoFLlRt2cyjnkzZve/AUAK6GHuH03MnAi0DibJJI/ZbDaKqoHOA2BSK+Het vFMOQmFAPpfSFx5rOWdRPO9hZ6hv3QTpzMHnV88hkKeKYSULsjU8myjPUBf6wtLttVgC 6tZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=QPuSTCPU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b24si4479821edy.271.2020.06.26.01.35.18; Fri, 26 Jun 2020 01:35:41 -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; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=QPuSTCPU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725876AbgFZIev (ORCPT + 99 others); Fri, 26 Jun 2020 04:34:51 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:48716 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725355AbgFZIev (ORCPT ); Fri, 26 Jun 2020 04:34:51 -0400 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 05Q8S7xw134511; Fri, 26 Jun 2020 08:34:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=fjqGH22vN8tmHJC5Ez+rpYalehtYxTKAP/PTFFOVU+A=; b=QPuSTCPUBeUywJ4cdRVBcX4j4qAoWBQytlLuZdN8MuV+SPw1Pi89PDGBSLyyDKjhyR2m L82kVyC4OqKWbbN2mH97QSXn6bVN/zrkmZboSY4/2cRKkHljjfKkWr3zq9bDGGAGlURz PBokYIZZsnNwwLnsg7DqOOob7KkSmJPknzjAbTLpJivOdT26/sxOL2o+dGxTVxrTdlIe M7sxDkAy8hM6c52o5QOeAoPToT1B7eCWVjSg3NxxPukODuVkVCecOGTpBSeieBUuernO 6ynvVrBtNdIAqal3L2QmAfCAdG1c138nJ28JSt7EL9fhrLWlclDFbbb9Y13wWVQoR4Cs GQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 31uusu4ufe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 26 Jun 2020 08:34:46 +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 05Q8YKSl009278; Fri, 26 Jun 2020 08:34:46 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 31uurbp4bd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Jun 2020 08:34:46 +0000 Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 05Q8YhU9017943; Fri, 26 Jun 2020 08:34:43 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 26 Jun 2020 08:34:43 +0000 Date: Fri, 26 Jun 2020 11:34:36 +0300 From: Dan Carpenter To: Coiby Xu Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman , "supporter:QLOGIC QLGE 10Gb ETHERNET DRIVER" , open list , Manish Chopra , "open list:QLOGIC QLGE 10Gb ETHERNET DRIVER" Subject: Re: [PATCH 2/2] staging: qlge: fix else after return or break Message-ID: <20200626083436.GG2549@kadam> References: <20200625215755.70329-1-coiby.xu@gmail.com> <20200625215755.70329-3-coiby.xu@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200625215755.70329-3-coiby.xu@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9663 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006260062 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9663 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 bulkscore=0 cotscore=-2147483648 malwarescore=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=999 phishscore=0 priorityscore=1501 spamscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006260061 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 26, 2020 at 05:57:55AM +0800, Coiby Xu wrote: > @@ -1404,11 +1403,10 @@ static void ql_dump_cam_entries(struct ql_adapter *qdev) > pr_err("%s: Failed read of mac index register\n", > __func__); > return; ^^^^^^ > - } else { > - if (value[0]) > - pr_err("%s: MCAST index %d CAM Lookup Lower = 0x%.08x:%.08x\n", > - qdev->ndev->name, i, value[1], value[0]); > } > + if (value[0]) > + pr_err("%s: MCAST index %d CAM Lookup Lower = 0x%.08x:%.08x\n", > + qdev->ndev->name, i, value[1], value[0]); > } > ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > } > @@ -1427,11 +1425,10 @@ void ql_dump_routing_entries(struct ql_adapter *qdev) > pr_err("%s: Failed read of routing index register\n", > __func__); > return; ^^^^^^ > - } else { > - if (value) > - pr_err("%s: Routing Mask %d = 0x%.08x\n", > - qdev->ndev->name, i, value); > } > + if (value) > + pr_err("%s: Routing Mask %d = 0x%.08x\n", > + qdev->ndev->name, i, value); > } > ql_sem_unlock(qdev, SEM_RT_IDX_MASK); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > } This is not caused by your patch, but in these two functions we return without dropping the lock. There may be other places as well, but these are the two I can see without leaving my email client. Do you think you could fix that before we forget? Just change the return to a break to fix the bug. regards, dan carpenter