Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8321080rwi; Tue, 25 Oct 2022 05:25:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7rFaHtHKb4gumgG/X8BIEolarceoC5EFeFG1nySiADVS4irJCalvhmIB71FXOdQtogrO3q X-Received: by 2002:a17:907:3ea4:b0:78e:25e2:c33b with SMTP id hs36-20020a1709073ea400b0078e25e2c33bmr30970750ejc.603.1666700728782; Tue, 25 Oct 2022 05:25:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666700728; cv=none; d=google.com; s=arc-20160816; b=WiruDQI+zY1n+mx+Eyc3CA9lvr/XktD3T+TVETwdYndHtd4ZJ4dHDo18rp7q5sOLeJ Njdt9gHOgeY1ts02NPRM9fqIzUpgFzaNrggWz6eKD2JyfZ9TQR44uKRoiXIUYIHokz/C HiICxfl9wJFAPKWKDXp3oNpWfEKQXNAVqoK7xCZDxVeUzQ0ZSraq3piQbjB8Pku+EPSL J8HIGLR7OBgKMNFeFvm0DV4Rq2PHCy9XX6dQi21ppaIvX80AB9cM7Zi5uzAeFnltELT3 8O7oDoD661b8sdALBtyuzOpS+TWCC0qYBWodpds8Pyjb2IoSwsAht7rvXnOf0Tw2ooLU WV6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KZKJWuEIeuKvDUZQNV7Smz75T6WROuu6Yr001YKXCbo=; b=v8KZ1zcO57UTVa3tTleRmAUqbYuZ88YhI8wPItABIP1B9DA0QnuKiNvzQQrbh4r81t Gjh6/bNQYPyuLM2YZ9RvncOnoR8r7of64jwqWOc8wSB3PeXHADkLJbysuCN47giMRtYL 4hKQlI6zXvKoiUNWJNYk8EJi4YTcbzfXxYGG2yDdnLPJAJWI22De4B7QsPSlwNWX0R0h KP6aILua3wpAONGDpggefdy34EumtOC8QFZo56gbjevdm1/8PYeN8HOvvcCEcbEhaT7Q 4i7b86MBSFznt7L8NV/MRUg/W7rDEhvF176gDqrVNvLmMKGYRbFsTrJw+Zs5nwlXl3GU +WCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=WO1e5oJR; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nc17-20020a1709071c1100b007a7d37e4683si3030092ejc.862.2022.10.25.05.25.11; Tue, 25 Oct 2022 05:25:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=WO1e5oJR; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231447AbiJYMWF (ORCPT + 65 others); Tue, 25 Oct 2022 08:22:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbiJYMWD (ORCPT ); Tue, 25 Oct 2022 08:22:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBE6D17A959; Tue, 25 Oct 2022 05:22:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 633C3618F6; Tue, 25 Oct 2022 12:22:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14463C433D6; Tue, 25 Oct 2022 12:22:00 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="WO1e5oJR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1666700519; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KZKJWuEIeuKvDUZQNV7Smz75T6WROuu6Yr001YKXCbo=; b=WO1e5oJROkFlQEDo4omTNY1UKBt7//EgstbWIjEpSV7b7Mvf3s5U/yAGhB84jeo0QDl699 jQgzD0XB6RKgkOff4bTSHpB+dz//GusPzz50WqYg+JBH78qH6ePZiDfAdXliafi5uk/RKn q3or7vKA/mdYQBKkK1HeeWGk2Nas1NM= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id ba7e1585 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 25 Oct 2022 12:21:58 +0000 (UTC) From: "Jason A. Donenfeld" To: linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, dan.carpenter@oracle.com, gregkh@linuxfoundation.org, kvalo@kernel.org, linux-wireless@vger.kernel.org Cc: "Jason A. Donenfeld" Subject: [PATCH v2] staging: rtl8192e: remove bogus ssid character sign test Date: Tue, 25 Oct 2022 14:21:50 +0200 Message-Id: <20221025122150.583617-1-Jason@zx2c4.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This error triggers on some architectures with unsigned `char` types: drivers/staging/rtl8192e/rtllib_softmac_wx.c:459 rtllib_wx_set_essid() warn: impossible condition '(extra[i] < 0) => (0-255 < 0)' But actually, the entire test is bogus, as ssids don't have any sign validity rules like that. So just remove this check look all together. Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Jason A. Donenfeld --- Changes v1->v2: - Remove ssid sign test entirely rather than casting to `s8 *`. drivers/staging/rtl8192e/rtllib_softmac_wx.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index f9589c5b62ba..1e5ad3b476ef 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -439,7 +439,7 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, union iwreq_data *wrqu, char *extra) { - int ret = 0, len, i; + int ret = 0, len; short proto_started; unsigned long flags; @@ -455,13 +455,6 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, goto out; } - for (i = 0; i < len; i++) { - if (extra[i] < 0) { - ret = -1; - goto out; - } - } - if (proto_started) rtllib_stop_protocol(ieee, true); -- 2.38.1