linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath10k: remove NULL ptr deref in variable init of ath10k_monitor_vdev_start
@ 2015-07-27 19:22 John W. Linville
  2015-07-28  5:11 ` Vasanthakumar Thiagarajan
  0 siblings, 1 reply; 4+ messages in thread
From: John W. Linville @ 2015-07-27 19:22 UTC (permalink / raw)
  To: linux-wireless; +Cc: ath10k, Kalle Valo, John W. Linville

In ath10k_monitor_vdev_start, chandef is initialized to NULL and then
channel is immediately thereafter initialized to chandef->chan (i.e.
NULL->chan).  This appears to be some sort of cut-n-paste error, since
the same assignment is done later (i.e. after chandef has been properly
assigned to a non-NULL value).  So, let's just remove this "brown paper
bag" typo/thinko... :-)

Coverity CID #1309505

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index c9a7d5b5dffc..2823222dea92 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -836,7 +836,7 @@ static inline int ath10k_vdev_setup_sync(struct ath10k *ar)
 static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id)
 {
 	struct cfg80211_chan_def *chandef = NULL;
-	struct ieee80211_channel *channel = chandef->chan;
+	struct ieee80211_channel *channel;
 	struct wmi_vdev_start_request_arg arg = {};
 	int ret = 0;
 
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath10k: remove NULL ptr deref in variable init of ath10k_monitor_vdev_start
  2015-07-27 19:22 [PATCH] ath10k: remove NULL ptr deref in variable init of ath10k_monitor_vdev_start John W. Linville
@ 2015-07-28  5:11 ` Vasanthakumar Thiagarajan
  2015-07-28 14:31   ` John W. Linville
  0 siblings, 1 reply; 4+ messages in thread
From: Vasanthakumar Thiagarajan @ 2015-07-28  5:11 UTC (permalink / raw)
  To: John W. Linville, linux-wireless; +Cc: ath10k, Kalle Valo

On Tuesday 28 July 2015 12:52 AM, John W. Linville wrote:
> In ath10k_monitor_vdev_start, chandef is initialized to NULL and then
> channel is immediately thereafter initialized to chandef->chan (i.e.
> NULL->chan).  This appears to be some sort of cut-n-paste error, since
> the same assignment is done later (i.e. after chandef has been properly
> assigned to a non-NULL value).  So, let's just remove this "brown paper
> bag" typo/thinko... :-)
>
> Coverity CID #1309505
>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> ---
>   drivers/net/wireless/ath/ath10k/mac.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
> index c9a7d5b5dffc..2823222dea92 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -836,7 +836,7 @@ static inline int ath10k_vdev_setup_sync(struct ath10k *ar)
>   static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id)
>   {
>   	struct cfg80211_chan_def *chandef = NULL;
> -	struct ieee80211_channel *channel = chandef->chan;
> +	struct ieee80211_channel *channel;
>   	struct wmi_vdev_start_request_arg arg = {};
>   	int ret = 0;
>

There is a similar change integrated recently, 
https://github.com/kvalo/ath/commit/19be9e9a7ac7e6050eab426283d2a87593cf6e82 .

Vasanth



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath10k: remove NULL ptr deref in variable init of ath10k_monitor_vdev_start
  2015-07-28  5:11 ` Vasanthakumar Thiagarajan
@ 2015-07-28 14:31   ` John W. Linville
  2015-07-28 16:23     ` Kalle Valo
  0 siblings, 1 reply; 4+ messages in thread
From: John W. Linville @ 2015-07-28 14:31 UTC (permalink / raw)
  To: Vasanthakumar Thiagarajan; +Cc: linux-wireless, ath10k, Kalle Valo

On Tue, Jul 28, 2015 at 10:41:11AM +0530, Vasanthakumar Thiagarajan wrote:
> On Tuesday 28 July 2015 12:52 AM, John W. Linville wrote:
> >In ath10k_monitor_vdev_start, chandef is initialized to NULL and then
> >channel is immediately thereafter initialized to chandef->chan (i.e.
> >NULL->chan).  This appears to be some sort of cut-n-paste error, since
> >the same assignment is done later (i.e. after chandef has been properly
> >assigned to a non-NULL value).  So, let's just remove this "brown paper
> >bag" typo/thinko... :-)
> >
> >Coverity CID #1309505
> >
> >Signed-off-by: John W. Linville <linville@tuxdriver.com>
> >---
> >  drivers/net/wireless/ath/ath10k/mac.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
> >index c9a7d5b5dffc..2823222dea92 100644
> >--- a/drivers/net/wireless/ath/ath10k/mac.c
> >+++ b/drivers/net/wireless/ath/ath10k/mac.c
> >@@ -836,7 +836,7 @@ static inline int ath10k_vdev_setup_sync(struct ath10k *ar)
> >  static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id)
> >  {
> >  	struct cfg80211_chan_def *chandef = NULL;
> >-	struct ieee80211_channel *channel = chandef->chan;
> >+	struct ieee80211_channel *channel;
> >  	struct wmi_vdev_start_request_arg arg = {};
> >  	int ret = 0;
> >
> 
> There is a similar change integrated recently,
> https://github.com/kvalo/ath/commit/19be9e9a7ac7e6050eab426283d2a87593cf6e82

OK.  I don't see much point in the NULL assignment for channel, but the main
point is to avoide the chandef->chan part.

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath10k: remove NULL ptr deref in variable init of ath10k_monitor_vdev_start
  2015-07-28 14:31   ` John W. Linville
@ 2015-07-28 16:23     ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2015-07-28 16:23 UTC (permalink / raw)
  To: John W. Linville; +Cc: Vasanthakumar Thiagarajan, linux-wireless, ath10k

"John W. Linville" <linville@tuxdriver.com> writes:

> On Tue, Jul 28, 2015 at 10:41:11AM +0530, Vasanthakumar Thiagarajan wrote:
>> On Tuesday 28 July 2015 12:52 AM, John W. Linville wrote:
>> >In ath10k_monitor_vdev_start, chandef is initialized to NULL and then
>> >channel is immediately thereafter initialized to chandef->chan (i.e.
>> >NULL->chan).  This appears to be some sort of cut-n-paste error, since
>> >the same assignment is done later (i.e. after chandef has been properly
>> >assigned to a non-NULL value).  So, let's just remove this "brown paper
>> >bag" typo/thinko... :-)
>> >
>> >Coverity CID #1309505
>> >
>> >Signed-off-by: John W. Linville <linville@tuxdriver.com>

[...]

>> There is a similar change integrated recently,
>> https://github.com/kvalo/ath/commit/19be9e9a7ac7e6050eab426283d2a87593cf6e82
>
> OK.  I don't see much point in the NULL assignment for channel, but the main
> point is to avoide the chandef->chan part.

Yeah, that was an oversight in my review. Want to send a patch to fix
that? :)

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-28 16:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-27 19:22 [PATCH] ath10k: remove NULL ptr deref in variable init of ath10k_monitor_vdev_start John W. Linville
2015-07-28  5:11 ` Vasanthakumar Thiagarajan
2015-07-28 14:31   ` John W. Linville
2015-07-28 16:23     ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).