[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200626083436.GG2549@kadam>
Date:   Fri, 26 Jun 2020 11:34:36 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Coiby Xu <coiby.xu@...il.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 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
Powered by blists - more mailing lists
 
