From patchwork Fri May 8 12:34:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 226245 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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 39EAFC38A2A for ; Fri, 8 May 2020 12:47:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 123E02145D for ; Fri, 8 May 2020 12:47:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942029; bh=b1reyi0WARpFwl48mYlPq8Jcm5QCOzjbgJtms3E5qh8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=XANoHLAgPb+kAUtyrG5ua7pKQhusrJresHPkgqXhmPGoPDsj6lN0dtL2HVgVo3t0+ 1Yp63pMgsuqluN9V8eueYSNAKAmOMACumC3wG7g35PmkVAi0U291MCppRFarqRZmX4 Vj3ou2djCUExHAbth8oWKq735r0yj6WQ84k/buJI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729510AbgEHMrH (ORCPT ); Fri, 8 May 2020 08:47:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:49100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727902AbgEHMrE (ORCPT ); Fri, 8 May 2020 08:47:04 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6B3BD2145D; Fri, 8 May 2020 12:47:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588942023; bh=b1reyi0WARpFwl48mYlPq8Jcm5QCOzjbgJtms3E5qh8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YxMCmKHBQnz52anrxfi1lkkfnpbgtrcmKMWEXgdTXYW3fyb9Cc3qKv/njLeVPl9NG EVo/GYzBrVAudOrWp+arIaSNXEh4o7THr1jj8qIYdFPTzcrRCpnawmyYsMOAOE4ArD nT+zr1+jYHaM8OSqaUrVmKIQzPQphlXznwSMLEuk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , "David S. Miller" Subject: [PATCH 4.4 265/312] et131x: Fix logical vs bitwise check in et131x_tx_timeout() Date: Fri, 8 May 2020 14:34:16 +0200 Message-Id: <20200508123143.075399953@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123124.574959822@linuxfoundation.org> References: <20200508123124.574959822@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Florian Fainelli commit de702da7a823ab0c4a1e53ed79a2695f0d453855 upstream. We should be using a logical check here instead of a bitwise operation to check if the device is closed already in et131x_tx_timeout(). Reported-by: coverity (CID 146498) Fixes: 38df6492eb511 ("et131x: Add PCIe gigabit ethernet driver et131x to drivers/net") Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/agere/et131x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/agere/et131x.c +++ b/drivers/net/ethernet/agere/et131x.c @@ -3854,7 +3854,7 @@ static void et131x_tx_timeout(struct net unsigned long flags; /* If the device is closed, ignore the timeout */ - if (~(adapter->flags & FMP_ADAPTER_INTERRUPT_IN_USE)) + if (!(adapter->flags & FMP_ADAPTER_INTERRUPT_IN_USE)) return; /* Any nonrecoverable hardware error?