From patchwork Mon Nov 5 20:17:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pontus Fuchs X-Patchwork-Id: 1700271 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 6D3CFDF2AB for ; Mon, 5 Nov 2012 20:18:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753038Ab2KEUSJ (ORCPT ); Mon, 5 Nov 2012 15:18:09 -0500 Received: from mail-lb0-f174.google.com ([209.85.217.174]:64819 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752788Ab2KEUSI (ORCPT ); Mon, 5 Nov 2012 15:18:08 -0500 Received: by mail-lb0-f174.google.com with SMTP id n3so4583139lbo.19 for ; Mon, 05 Nov 2012 12:18:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=Y7WkeUA8DNMa7d7K3A28gsZwt4dIFPNAXk8iRm+RLOM=; b=gPDYqTCwDsF5zIyN2Xx73a6VVy9/wsBwC3QZw4u4Eir6fVIRdj/LaqIc98v1qDF2yd fg/Y4MnjTwszrhfTt6U3fGA9T782CS1SJ8B6xg4Fbh8QDrytWtSKcUF9Sg+LBcuqWHEe ir/mE7Hwrk5dRVPUnX6PxYNDU8q/CXSXwn2ryczsdhCj9Jg84UNUFz0o1YGSnJZyp/Mr M8NY3YxwqnwX2rMI8+lE9OGQZEUgI+R+uClyGB+OmCkSS1mQ4RKvvNz9CTAbBRkWnyl7 Ke5Z77hKw5G0R+A3Z3wQ7fj6F0pVgbgXg4FMsPbDZhSdDxwjvh2YV8gdJh6i9SWmjYhM Tmxg== Received: by 10.152.108.197 with SMTP id hm5mr10246723lab.45.1352146686503; Mon, 05 Nov 2012 12:18:06 -0800 (PST) Received: from localhost.localdomain (h209n4-m-sp-d1.ias.bredband.telia.com. [78.70.41.209]) by mx.google.com with ESMTPS id gt17sm6071916lab.6.2012.11.05.12.18.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Nov 2012 12:18:05 -0800 (PST) From: Pontus Fuchs To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, Pontus Fuchs Subject: [PATCH 2/2] ar5523: Don't dereference sta if NULL Date: Mon, 5 Nov 2012 21:17:51 +0100 Message-Id: <1352146671-4318-2-git-send-email-pontus.fuchs@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1352146671-4318-1-git-send-email-pontus.fuchs@gmail.com> References: <1352146671-4318-1-git-send-email-pontus.fuchs@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org A missing else caused a potential NULL dereference. Reported-by: Yuanhan Liu Signed-off-by: Pontus Fuchs --- drivers/net/wireless/ath/ar5523/ar5523.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ar5523/ar5523.c b/drivers/net/wireless/ath/ar5523/ar5523.c index bb774b3..c312899 100644 --- a/drivers/net/wireless/ath/ar5523/ar5523.c +++ b/drivers/net/wireless/ath/ar5523/ar5523.c @@ -1196,8 +1196,8 @@ static void ar5523_create_rateset(struct ar5523 *ar, if (!sta) { ar5523_info(ar, "STA not found. Cannot set rates\n"); sta_rate_set = bss_conf->basic_rates; - } - sta_rate_set = sta->supp_rates[ar->hw->conf.channel->band]; + } else + sta_rate_set = sta->supp_rates[ar->hw->conf.channel->band]; ar5523_dbg(ar, "sta rate_set = %08x\n", sta_rate_set);