Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1092697ybn; Wed, 2 Oct 2019 10:43:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOeZGIor7+0gursyteMmqUNdssVHyaRw6jhLMheeB+kBeUdycvlAOYtmTXP4+jo6tDqG80 X-Received: by 2002:a17:906:b259:: with SMTP id ce25mr3913208ejb.229.1570038184068; Wed, 02 Oct 2019 10:43:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570038184; cv=none; d=google.com; s=arc-20160816; b=BqR/QAkavEp8RxnLIwaILK9FdjJ4fkQdXYTdO0m8rQsgGHgvUIfl7+nG1hG20UpjAj yE1Bm24QYb/ykJibq/yHUNl/tRGfAfYPN9Z0bn5Ypi6ZbBS85vXHn5GeCb3OXLdia/W2 tr4J89oqOyGHcaI1byKCkVvDP2oJbekNm1HDwBdJNlOcWGFBa+gMehKXQpFNZCfsC1vz Des3VasaRRSDsW8+pwCromYYBvv7V47VmpNVxXZSNtOD5fNYv0rKfPW545oZagQKFhXX CalQLcTcgVooY2CwmYS2VGujAmUCXqNGDQMFETGkPNrdnL0lm4WG0/2iR9pF10EnaVlF 54lg== 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 :message-id:date:subject:cc:to:from; bh=mUZyNZheTJw4GC5851yKEfVpxUBc4f7pMP1DSM9q8jg=; b=weYEVYdMXLBYRUd/MDDyy0A9tL8UbKpaOJMQmNggxg24O76/1MJCl1W2iql1rQEfj4 +oCkCx6H62JfRLQEEtgWp0PLlx7OYmnq0bcWimibupjsOm3jTdA1M1kw69yJLSp6R8HI y/HK2rtoUPnLHLfriypaLyzjjquH/N9rtmq6JD4LqkmB+wjqDiiLaI4Fe21os5MWRZMY 6xxodmLXXP7RygHO4JGe+76ZVaQlHJsYLTWcNEmjfAjCHNoG9pkpoYO4N5PVC6uwufBW 7BkHFDUf1x1puI5EyM0BgdCLDN9i4mGeyCu3Dbxc+XI95kIAv6okrMJ+erzZsK2ZjviY AQcQ== ARC-Authentication-Results: i=1; mx.google.com; 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 p22si10591504ejf.278.2019.10.02.10.42.39; Wed, 02 Oct 2019 10:43:04 -0700 (PDT) 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; 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 S1728454AbfJBRlO (ORCPT + 99 others); Wed, 2 Oct 2019 13:41:14 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:40853 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727721AbfJBRlO (ORCPT ); Wed, 2 Oct 2019 13:41:14 -0400 Received: by mail-wr1-f65.google.com with SMTP id l3so20635392wru.7; Wed, 02 Oct 2019 10:41:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mUZyNZheTJw4GC5851yKEfVpxUBc4f7pMP1DSM9q8jg=; b=TxqaMUzCDK4ovLkDJMl/hpwV9fisOrEBcq8rG7EFqfIoZeFC4i4T1p2HigugaA7msj cctE6s7h9qSHrtGNYOxs8FEUeqK+Fq4Z7iMWIlrhymawCSg7eo+2M2k8ejJfQKJ/ENO1 grQwjgkUuJE4gV+WWodrZV+Y63EhFrKD8nqUt/zep7YJ8UHpAyrgN+0cP8NcYObZy0L8 AjZtiO3U/8TFtSFzSxVWoio8/fLOXKImCw96MdNJOMf2/QyFjVRN485GVuMsqtaQzcGM 8kzKfuslP92PB/irvSi4CPg3XcjF88w6yFIcUpQjS3GXRoG6K5E7LALUVJy2CBCaf5BB QJhQ== X-Gm-Message-State: APjAAAV3cokkqB/SUKK45mKjxZm+tvMU3bxuNQ8hJjUdXk13bVD/mk1l XbyHUyEhXoHYQnqhvaK9jAg= X-Received: by 2002:adf:e689:: with SMTP id r9mr3970235wrm.62.1570038072117; Wed, 02 Oct 2019 10:41:12 -0700 (PDT) Received: from green.intra.ispras.ru (bran.ispras.ru. [83.149.199.196]) by smtp.googlemail.com with ESMTPSA id f186sm7879628wmg.21.2019.10.02.10.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2019 10:41:11 -0700 (PDT) From: Denis Efremov To: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Denis Efremov , Greg Kroah-Hartman , stable@vger.kernel.org Subject: [PATCH] staging: wlan-ng: fix uninitialized variable Date: Wed, 2 Oct 2019 20:41:03 +0300 Message-Id: <20191002174103.1274-1-efremov@linux.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The result variable in prism2_connect() can be used uninitialized on path !channel --> ... --> is_wep --> sme->key --> sme->key_idx >= NUM_WEPKEYS. This patch initializes result with 0. Cc: Greg Kroah-Hartman Cc: stable@vger.kernel.org Signed-off-by: Denis Efremov --- drivers/staging/wlan-ng/cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c index eee1998c4b18..d426905e187e 100644 --- a/drivers/staging/wlan-ng/cfg80211.c +++ b/drivers/staging/wlan-ng/cfg80211.c @@ -441,7 +441,7 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev, int chan = -1; int is_wep = (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP40) || (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP104); - int result; + int result = 0; int err = 0; /* Set the channel */ -- 2.21.0