Thread (1 message) 1 message, 1 author, 2016-05-09

Re: [PATCH 2/2] mac80211_hwsim: Allow managing radios from non-initial namespaces

From: Johannes Berg <hidden>
Date: 2016-05-09 07:31:30
Also in: linux-wireless

quoted
+	data->netgroup = *(int *)net_generic(net, hwsim_net_id);
Anything doing *(integer_type *) rings alarm bells.

I suspect you should be defining a structure that currently contains
one integer member.
Something (maybe a compile time assert) needs to check that buffer
space you are accessing (where ever it is) is large enough.
It does look a bit awkward, but there's no value in having a struct -
you still have an opaque pointer here and cast it to something whose
size you assume to be present... it really makes no difference.

johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help