[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200626114104.pst7b2yplsblmw6k@Rk>
Date: Fri, 26 Jun 2020 19:41:04 +0800
From: Coiby Xu <coiby.xu@...il.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: devel@...verdev.osuosl.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"supporter:QLOGIC QLGE 10Gb ETHERNET DRIVER"
<GR-Linux-NIC-Dev@...vell.com>,
open list <linux-kernel@...r.kernel.org>,
Manish Chopra <manishc@...vell.com>,
"open list:QLOGIC QLGE 10Gb ETHERNET DRIVER" <netdev@...r.kernel.org>
Subject: Re: [PATCH 2/2] staging: qlge: fix else after return or break
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
Powered by blists - more mailing lists