linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] nl80211.c: Fixed the wdev_id being used uninitialized.
@ 2014-09-01 11:54 Shakil A Khan
  2014-09-01 12:07 ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Shakil A Khan @ 2014-09-01 11:54 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, netdev, davem, linville, johannes, Shakil A Khan

Signed-off-by: Shakil A Khan <shakilk1729@gmail.com>
---
 net/wireless/nl80211.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index df7b133..6cd7df2 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -76,7 +76,7 @@ __cfg80211_wdev_from_attrs(struct net *netns, struct nlattr **attrs)
 	struct wireless_dev *result = NULL;
 	bool have_ifidx = attrs[NL80211_ATTR_IFINDEX];
 	bool have_wdev_id = attrs[NL80211_ATTR_WDEV];
-	u64 wdev_id;
+	u64 wdev_id = 0;
 	int wiphy_idx = -1;
 	int ifidx = -1;
 
-- 
1.7.1


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

* Re: [PATCH 2/2] nl80211.c: Fixed the wdev_id being used uninitialized.
  2014-09-01 11:54 [PATCH 2/2] nl80211.c: Fixed the wdev_id being used uninitialized Shakil A Khan
@ 2014-09-01 12:07 ` Johannes Berg
  2014-09-01 12:33   ` Shakil A Khan
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2014-09-01 12:07 UTC (permalink / raw)
  To: Shakil A Khan; +Cc: linux-wireless, linux-kernel, netdev, davem, linville


> +	u64 wdev_id = 0;

it's not used uninitialized, NACK.

johannes


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

* Re: [PATCH 2/2] nl80211.c: Fixed the wdev_id being used uninitialized.
  2014-09-01 12:07 ` Johannes Berg
@ 2014-09-01 12:33   ` Shakil A Khan
  2014-09-01 12:42     ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Shakil A Khan @ 2014-09-01 12:33 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, linux-kernel, netdev, davem, linville

On Monday 01 September 2014 08:07:38 Johannes Berg wrote:
> > +	u64 wdev_id = 0;
> 
> it's not used uninitialized, NACK.
> 
> johannes
> 

wdev_id can be used uninitialized if  have_wdev_id turns to be false, which may happen if the entry for NL80211_ATTR_WDEV is removed in future. Who knows.

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

* Re: [PATCH 2/2] nl80211.c: Fixed the wdev_id being used uninitialized.
  2014-09-01 12:33   ` Shakil A Khan
@ 2014-09-01 12:42     ` Johannes Berg
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2014-09-01 12:42 UTC (permalink / raw)
  To: Shakil A Khan; +Cc: linux-wireless, linux-kernel, netdev, davem, linville

On Mon, 2014-09-01 at 08:33 -0400, Shakil A Khan wrote:
> On Monday 01 September 2014 08:07:38 Johannes Berg wrote:
> > > +	u64 wdev_id = 0;
> > 
> > it's not used uninitialized, NACK.
> > 
> > johannes
> > 
> 
> wdev_id can be used uninitialized if  have_wdev_id turns to be false,
> which may happen if the entry for NL80211_ATTR_WDEV is removed in
> future. Who knows.

In which case the compiler will warn about it. If you were to use a
newer compiler now, you wouldn't see the warning.

johannes



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

end of thread, other threads:[~2014-09-01 12:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-01 11:54 [PATCH 2/2] nl80211.c: Fixed the wdev_id being used uninitialized Shakil A Khan
2014-09-01 12:07 ` Johannes Berg
2014-09-01 12:33   ` Shakil A Khan
2014-09-01 12:42     ` Johannes Berg

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).