Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4825845ybl; Wed, 22 Jan 2020 05:28:02 -0800 (PST) X-Google-Smtp-Source: APXvYqxk1UbIMjsztNPXPsm+TSpRPIVcPQDaaEY8M8UGQZdSXSAlQHRr7dOHEnCB7GeyhXhtZzmm X-Received: by 2002:a9d:4e92:: with SMTP id v18mr7116155otk.47.1579699682609; Wed, 22 Jan 2020 05:28:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699682; cv=none; d=google.com; s=arc-20160816; b=PygdK7mv72h0++xYN2JN+43Yxes3TEXHBDcjcXwIlNubtocg3uRdUIEASADfenu+l4 69gzcNCuYmRhKB4/UVRzsCkaeI+QNea+EkOOft9febXDV2b/dL7jz0udTPq1zoAkQOeY 7Vo+4sc9yHlTMnHqZWY7MZhneS198vyuYZxuPemGvKM92yJqVXcz3PE1s0zbJNNiAtqf 5xVESl0Pl8qD3y/z58nTLb/HCO8ViBgAPRamJjLWaPM1zTQAEz4eCYT8fIWPpYuZixBN Xb6u2dxgurbfeX0c3XmE+wb7JtxqaoiQRUX0NbCQG8rA1o8JmmNJF6uimKW3UlB2ePkT +L7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/Y3D+rukMk0cGuXVZqfxm5ifQtSPHTrfQ3H3h8kYeWE=; b=i368L3fgRfG94etvn6mfM2NY4OpdUdwqIVmCCBOXQY3rMTe/HWnZD1BtH2DcU2YNyQ d0YxkiGiqIstaZ8nf+7IVlHqVWMPIuol4cV++RP66OhZw2vwAynfQm5etOXAPqO5fGbH KDi2xjgaqUgCq1T8FIEWzCOZhJXd0Ln3bS3WB/CnG0sWa9b1TjxFsa+WUgvg/rva+6if 7VJvNyWWLVk8HrHs7NudwCPQ94s4raqWq9/etGhAv8sny0LgldC1xWS4asnZGoNV90NA Of66mIXt8o0prmqQOWp0VHkJ5gsYJ/53Fgf/kPUz3jZ31vEOMffr47IUttNKH25Cw0j3 78nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OlPpeAtK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j17si22916667otl.278.2020.01.22.05.27.50; Wed, 22 Jan 2020 05:28:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OlPpeAtK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731342AbgAVNZi (ORCPT + 99 others); Wed, 22 Jan 2020 08:25:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:45842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730992AbgAVNZf (ORCPT ); Wed, 22 Jan 2020 08:25:35 -0500 Received: from localhost (unknown [84.241.205.26]) (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 A6A552467B; Wed, 22 Jan 2020 13:25:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699535; bh=rVq4mOa/HPylGUTAZCFbhU3NDARoOXa54ONl8NbBoaM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OlPpeAtKHjSD8P90wUsHnY/drBx6DEJgNY7aekJO/HYq39L9h9Gn/hhdICPIyWLIh 7e2BaFK31VoO+76R1sXAp2J92H5LwMfkxbfeFdD9zwuWYQ5uURLFS5lgb5+Di47kDb DwepPZqcjIFUfChMgRZo84kVdZT1j4rZC+Qqdpsk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Kalle Valo Subject: [PATCH 5.4 175/222] cw1200: Fix a signedness bug in cw1200_load_firmware() Date: Wed, 22 Jan 2020 10:29:21 +0100 Message-Id: <20200122092846.230821180@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter commit 4a50d454502f1401171ff061a5424583f91266db upstream. The "priv->hw_type" is an enum and in this context GCC will treat it as an unsigned int so the error handling will never trigger. Fixes: a910e4a94f69 ("cw1200: add driver for the ST-E CW1100 & CW1200 WLAN chipsets") Signed-off-by: Dan Carpenter Signed-off-by: Kalle Valo Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/st/cw1200/fwio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/net/wireless/st/cw1200/fwio.c +++ b/drivers/net/wireless/st/cw1200/fwio.c @@ -320,12 +320,12 @@ int cw1200_load_firmware(struct cw1200_c goto out; } - priv->hw_type = cw1200_get_hw_type(val32, &major_revision); - if (priv->hw_type < 0) { + ret = cw1200_get_hw_type(val32, &major_revision); + if (ret < 0) { pr_err("Can't deduce hardware type.\n"); - ret = -ENOTSUPP; goto out; } + priv->hw_type = ret; /* Set DPLL Reg value, and read back to confirm writes work */ ret = cw1200_reg_write_32(priv, ST90TDS_TSET_GEN_R_W_REG_ID,