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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 91565C433E0 for ; Fri, 26 Jun 2020 11:41:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6EF322082E for ; Fri, 26 Jun 2020 11:41:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bznUaDar" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728761AbgFZLlO (ORCPT ); Fri, 26 Jun 2020 07:41:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725853AbgFZLlN (ORCPT ); Fri, 26 Jun 2020 07:41:13 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0896FC08C5C1; Fri, 26 Jun 2020 04:41:13 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id cm23so4837013pjb.5; Fri, 26 Jun 2020 04:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=QP1W6LTqb3HrT7UeS27vyFiMv8Qdl9CewxQNnYMt6JQ=; b=bznUaDar0g9khomHuRgTnGoqDP76X5CaZIYsjxDjZw/+nxZeubAUWj+ak/AQex7eFH N0pCNrWEdMeLKjkg+Wa/oqdPycEJVFZpdmGdurIYc7H3kI6Ea/gqJWUhc/rYTQDGzbDA xR8n+CSvpn+LCEykMMU4T3eXQ7sdCpHvPXa+rlJ8vBi6iLXyZ9f4ltI02/KAIdcir+cu WDkMlz63kzFy0i+PR3TWNoiQu1KgfCnK/PG+R/lX1cRgwIC9mviETAhBUpDcGO03hU/k v5DT2FJ6a+DJf3XHWDkPju2Mbk48IkuW15kT17+WjnRoWBoShSNQavJ7PEfAc2u3HYnh o7wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QP1W6LTqb3HrT7UeS27vyFiMv8Qdl9CewxQNnYMt6JQ=; b=N6ba/PRZ8UNgs4PzSJlFYQ+t4Q4B9kLN8KggBYF1DQUvvic9Ne7RTxU/zqcfLsKACN b00I6Y8FIH9dB0RurhBOyLndxr96kF0/zwMX4GXJ2gZUWwmjz1CW9o5bh9JlVsQ+MUnY NYp+fi5j61zNBgKpKyInC3sg8fY/YIB1KcuSgu0epz2Wt8aM3YGrarCYSovzjJySfYlZ x+1yeqbo5nmXxr5gZKorAS2oRXvmk1MeUNdZ1RWtQOG6XvPHhgnkaZfKvNvjN72WOzK4 NJpzFORekVFF82o4YQ2Cjgl0Sf+8y34vPm89Cpw8UYSgYAKeOEY6UiXOuqExzIacf52F ub7Q== X-Gm-Message-State: AOAM531YmDCQ+1Pr/1fz+hiFRRZ7aafkgncOv440MFxj01VTK4zbEGq4 frJedFsyAiwO3dYqcm0QQAc= X-Google-Smtp-Source: ABdhPJz0eY6Y6F4elZnSER9ALuIHX/WgM2RzhCQHvumXJyVAiDZ+oZ8s0y0/QAtEEyT6e8dy8qlBHw== X-Received: by 2002:a17:90a:de18:: with SMTP id m24mr3158430pjv.49.1593171672566; Fri, 26 Jun 2020 04:41:12 -0700 (PDT) Received: from localhost ([2001:e42:102:1532:160:16:113:140]) by smtp.gmail.com with ESMTPSA id 4sm22490829pgk.68.2020.06.26.04.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 04:41:12 -0700 (PDT) From: Coiby Xu X-Google-Original-From: Coiby Xu Date: Fri, 26 Jun 2020 19:41:04 +0800 To: Dan Carpenter 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: <20200626114104.pst7b2yplsblmw6k@Rk> References: <20200625215755.70329-1-coiby.xu@gmail.com> <20200625215755.70329-3-coiby.xu@gmail.com> <20200626083436.GG2549@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200626083436.GG2549@kadam> 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 11:34:36AM +0300, Dan Carpenter wrote: >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. Sure, I'll address this issue in the next series of patches. Thank you for bringing up this issue! -- Best regards, Coiby 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=-0.8 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, 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 BD788C433DF for ; Fri, 26 Jun 2020 11:41:16 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 91F842082E for ; Fri, 26 Jun 2020 11:41:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bznUaDar" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91F842082E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 66A27874E0; Fri, 26 Jun 2020 11:41:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I2LnKvGlWPxA; Fri, 26 Jun 2020 11:41:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id D4F5887E24; Fri, 26 Jun 2020 11:41:15 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 9B0A61BF36E for ; Fri, 26 Jun 2020 11:41:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 97BE3874E0 for ; Fri, 26 Jun 2020 11:41:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cK1vxg93lVzs for ; Fri, 26 Jun 2020 11:41:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by hemlock.osuosl.org (Postfix) with ESMTPS id 01C5787D0E for ; Fri, 26 Jun 2020 11:41:12 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id k1so4195138pls.2 for ; Fri, 26 Jun 2020 04:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=QP1W6LTqb3HrT7UeS27vyFiMv8Qdl9CewxQNnYMt6JQ=; b=bznUaDar0g9khomHuRgTnGoqDP76X5CaZIYsjxDjZw/+nxZeubAUWj+ak/AQex7eFH N0pCNrWEdMeLKjkg+Wa/oqdPycEJVFZpdmGdurIYc7H3kI6Ea/gqJWUhc/rYTQDGzbDA xR8n+CSvpn+LCEykMMU4T3eXQ7sdCpHvPXa+rlJ8vBi6iLXyZ9f4ltI02/KAIdcir+cu WDkMlz63kzFy0i+PR3TWNoiQu1KgfCnK/PG+R/lX1cRgwIC9mviETAhBUpDcGO03hU/k v5DT2FJ6a+DJf3XHWDkPju2Mbk48IkuW15kT17+WjnRoWBoShSNQavJ7PEfAc2u3HYnh o7wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QP1W6LTqb3HrT7UeS27vyFiMv8Qdl9CewxQNnYMt6JQ=; b=FtvdCu7yhFvfudvzDDOixOfWlsk3B4s6ZaKK+Vp0mLKcyom+NjTx0ZPtwrVzL+rElw 3LuAr8M5/kvx5GEuPlgCZspY1boRBniDdcfDSDeoJI1YmAfVZZjAFY+3WzpTqfFHrP9J XpW7DYYMQaNtkacOskzS8VCjsNpJ1JO6mCpD9vE+EqUXhZtboVAtK7PkRYzdW3KgZYUP pk7+RaDDEZybgqXGb03dfJppy8poHZ0n2EyzeZv2BbKhIz4ZfhP9dNfGVBXJYkhzhskC tAXwWYK863pA+G+sk21k+iPhFxUCEYWb5kO+u7/UdujUuGzEZwYNVQeYkE1IGkwp+z9E AlmA== X-Gm-Message-State: AOAM530xCgBRKCtd3MSeRLD9WPnEQYRbQiboRj/R5lshAOpT8yuZZzHO pISLYZ7ERmQzLolJshVfBrQ= X-Google-Smtp-Source: ABdhPJz0eY6Y6F4elZnSER9ALuIHX/WgM2RzhCQHvumXJyVAiDZ+oZ8s0y0/QAtEEyT6e8dy8qlBHw== X-Received: by 2002:a17:90a:de18:: with SMTP id m24mr3158430pjv.49.1593171672566; Fri, 26 Jun 2020 04:41:12 -0700 (PDT) Received: from localhost ([2001:e42:102:1532:160:16:113:140]) by smtp.gmail.com with ESMTPSA id 4sm22490829pgk.68.2020.06.26.04.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 04:41:12 -0700 (PDT) From: Coiby Xu X-Google-Original-From: Coiby Xu Date: Fri, 26 Jun 2020 19:41:04 +0800 To: Dan Carpenter Subject: Re: [PATCH 2/2] staging: qlge: fix else after return or break Message-ID: <20200626114104.pst7b2yplsblmw6k@Rk> References: <20200625215755.70329-1-coiby.xu@gmail.com> <20200625215755.70329-3-coiby.xu@gmail.com> <20200626083436.GG2549@kadam> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200626083436.GG2549@kadam> X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, "supporter:QLOGIC QLGE 10Gb ETHERNET DRIVER" , Manish Chopra , Greg Kroah-Hartman , open list , "open list:QLOGIC QLGE 10Gb ETHERNET DRIVER" Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On Fri, Jun 26, 2020 at 11:34:36AM +0300, Dan Carpenter wrote: >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. Sure, I'll address this issue in the next series of patches. Thank you for bringing up this issue! -- Best regards, Coiby _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel