Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755784AbbGUP4P (ORCPT ); Tue, 21 Jul 2015 11:56:15 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:42244 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754653AbbGUP4N (ORCPT ); Tue, 21 Jul 2015 11:56:13 -0400 X-IronPort-AV: E=McAfee;i="5700,7163,7868"; a="221639458" X-IronPort-AV: E=Sophos;i="5.15,517,1432623600"; d="scan'208";a="27318955" From: Kalle Valo To: CC: "ath10k@lists.infradead.org" , "linux-wireless@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , PANKAJ MISHRA Subject: Re: [PATCH 1/1] ath10k: fixing wrong initialization of struct channel References: <1785807958.195941437479984203.JavaMail.weblogic@epmlwas04a> Date: Tue, 21 Jul 2015 18:56:05 +0300 In-Reply-To: <1785807958.195941437479984203.JavaMail.weblogic@epmlwas04a> (Maninder Singh's message of "Tue, 21 Jul 2015 11:59:44 +0000") Message-ID: <87bnf5mrmy.fsf@kamboji.qca.qualcomm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01F.na.qualcomm.com (10.85.0.32) To NALASEXR01G.na.qualcomm.com (10.49.56.53) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1325 Lines: 38 Maninder Singh writes: >>> chandef is initialized with NULL and on the very next line, >>> we are using it to get channel, which is not correct. >>> >>> channel should be initialized after obtaining chandef. >>> >>> Signed-off-by: Maninder Singh > >>How did you find this bug? > > Static anlysis reports this bug like coverity or any other static tool like cppcheck :- > > drivers/net/wireless/ath/ath10k/mac.c:839]: (error) Possible null pointer dereference: chandef Thanks. This is always good to add to the commit log so I did that: ath10k: fix wrong initialization of struct channel chandef is initialized with NULL and on the very next line, we are using it to get channel, which is not correct. Channel should be initialized after obtaining chandef. Found by cppcheck: ath/ath10k/mac.c:839]: (error) Possible null pointer dereference: chandef Signed-off-by: Maninder Singh Signed-off-by: Kalle Valo -- Kalle Valo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/