Smatch is warning about a dereference before we check for NULL.
This patch moves the dereference to after the NULL check.
Smatch warning:
drivers/staging/wlan-ng/cfg80211.c:345 prism2_scan() warn:
variable dereferenced before check 'request' (see line 332)
Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This pulls in the staging tree fixes in 3.6-rc6 into our branch to resolve the
merge issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
this removes the remaining return which the function actually
wants to return, for that it used goto failed and failed lable
have the return statement at the end of function, which is all
unnecessary, remove this and make the function return at the
places where it does the goto failed
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
this file is having all unnecessary return statements at the end of functions
which return void, remove all of them.
some of the functions still uses the return for having the goto end,
which the label end defined at the end of the function which returns
void, this will be cleaned up in next change
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
else is not required as such we can do with just with a single if
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
this is because this function does a deinit job and most of the
deinit functions are expected to return void. Also this function
doesn't fail anywhere..
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
the function p80211netdev_rx doesnt' need a return at the end
and also remove some new lines
the function p80211knetdev_set_mac_address doesn't need the result
variable assigned as it gets a return from p80211req_dorequest function
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
we dont need i to just return the status of register_netdev
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
the function prism2sta_commsqual_defer defines a goto done lable, which just
jumps to end of function, which we can achieve with out it
the hfa384x_drvr_getconfig doesn't need the result variable, we can
remove and just return the function
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
these functions doesn't need return at the end of the function
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
this function always returning 0, there are no callers that checks
the return of this function, make this function return void
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
the switch case doesn't have a break statement of DIDmsg_dot11req_mibget,
and DIDmsg_dot11req_mibset cases, and also cleanup the code to follow
the kernel coding way
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
default is redundant and remove it
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
goto done is not required and actually having goto done does
jumps the program to end of the function and calls return.
instead call return directly
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
goto done is not required and simple return is fine
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/prism2fw.c:240:5: warning: symbol 'prism2_fwapply' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:379:5: warning: symbol 'crcimage' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:443:6: warning: symbol 'free_chunks' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:465:6: warning: symbol 'free_srecs' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:492:5: warning: symbol 'mkimage' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:585:5: warning: symbol 'mkpdrlist' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:659:5: warning: symbol 'plugimage' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:767:5: warning: symbol 'read_cardpda' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:857:5: warning: symbol 'read_fwfile' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:981:5: warning: symbol 'writeimage' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:1133:5: warning: symbol 'validate_identity' was not declared. Should it be static?
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/prism2fw.c:127:18: warning: symbol 's3data' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:130:14: warning: symbol 'ns3plug' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:131:18: warning: symbol 's3plug' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:134:14: warning: symbol 'ns3crc' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:135:17: warning: symbol 's3crc' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:138:14: warning: symbol 'ns3info' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:139:18: warning: symbol 's3info' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:142:5: warning: symbol 'startaddr' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:145:14: warning: symbol 'nfchunks' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:146:17: warning: symbol 'fchunk' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:154:12: warning: symbol 'pda' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:155:21: warning: symbol 'nicid' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:156:20: warning: symbol 'rfid' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:157:20: warning: symbol 'macid' was not declared. Should it be static?
drivers/staging/wlan-ng/prism2fw.c:158:20: warning: symbol 'priid' was not declared. Should it be static?
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The function pointer scan in struct cfg80211_ops is not
supposed to be assigned a function with a struct net_device
pointer as an argument. Instead access the net_device struct
in the following way:
struct net_device *dev = request->wdev->netdev;
sparse gives these warnings:
drivers/staging/wlan-ng/cfg80211.c:726:17: warning:
incorrect type in initializer (incompatible argument 2
(different base types))
expected int ( *scan )( ... )
got int ( extern [toplevel] *<noident> )( ... )
drivers/staging/wlan-ng/cfg80211.c:726:2: warning:
initialization from incompatible pointer type [enabled by default]
drivers/staging/wlan-ng/cfg80211.c:726:2: warning:
(near initialization for ‘prism2_usb_cfg_ops.scan’)
[enabled by default]
Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
instead we would have used kzalloc, so our memory which is allocated will be set to 0.
codepath:
the code path here is prism2sta_probe_usb, calling when ever usb-dev id
and usb-vendor id e.t.c matches with what ever present in the MODULE_DEVICE_TABLE,
and in prism2sta_probe_usb , we call create_wlan, and its called nowhere else...
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix frame size (stack usage) warning by allocating and freeing
pointers to the data.
drivers/staging/wlan-ng/prism2fw.c:1115:1: warning: the frame size of 4288 bytes is larger than 2048 bytes
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
this patch fixes the coding style problems found by using checkpatch.pl
drivers/staging/wlan-ng/prism2fw.c:175: ERROR: "foo * bar" should be "foo *bar"
drivers/staging/wlan-ng/prism2fw.c:210: WARNING: line over 80 characters
drivers/staging/wlan-ng/prism2fw.c:596: WARNING: line over 80 characters
drivers/staging/wlan-ng/prism2fw.c:658: ERROR: "foo * bar" should be "foo *bar"
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
there are warnings that are reported by checkpatch.pl
fixed the following problems
drivers/staging/wlan-ng/cfg80211.c:130: WARNING: line over 80 characters
drivers/staging/wlan-ng/cfg80211.c:366: WARNING: line over 80 characters
drivers/staging/wlan-ng/cfg80211.c:543: WARNING: line over 80 characters
drivers/staging/wlan-ng/cfg80211.c:665: WARNING: line over 80 characters
drivers/staging/wlan-ng/cfg80211.c:692: WARNING: line over 80 characters
drivers/staging/wlan-ng/cfg80211.c:735: WARNING: line over 80 characters
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Function cfg80211_inform_bss returns a pointer to a referenced struct cfg80211_bss
but no information is needed from this struct in function prism2_scan and therefore
we release it by calling cfg80211_put_bss.
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Count is used to cap "req->bssindex.data" which is used as an offset
into the hw->scanresults->info.hscanresult.result[] array. The array
has only HFA384x_SCANRESULT_MAX (31) elements so the 32 is off by one.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
In commit 1ca1a92cc6 "Staging: wlan-ng: memsetting the wrong amount of
data" I changed the code so we didn't memset() past the end of the
msg1.bssid.data[] array. Walter Harms noticed that it was weird that
we were setting the len to 6 when there were 7 elements in the array.
Pavel Roskin pointed out that the intent of the code was actually to
memset() msg1.bssid.data.data[] which is a 6 character array.
Reported-by: Walter Harms <wharms@bfs.de>
Reported-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
p80211item_pstr6_t is the size of "msg1.bssid" (16 bytes) but
msg1.bssid.data is type p80211pstr6_t and it is smaller (7 bytes). We
had just set that memory to zeroes earlier and now we're writing over it
with 0xff because we're writing past the end of the struct.
I don't know if this actually causes a problem. It may be that we
initialize the extra 0xff bytes correctly later. But the current code
is obviously wrong and we should fix it.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
New kernel developer inspired by the 2010 FOSDEM talk. Running checkpatch on
p80211netdev.c gave the error: p80211netdev.c:153: ERROR: "foo * bar" should
be "foo *bar". Fixed it by doing what was suggested.
Signed-off-by: Sebastiaan de Haan <sebastiaan@sebastiaandehaan.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
We're getting the ssid length from the scan here. Let's cap it before
doing the memcpy().
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This converts the drivers in drivers/staging/* to use the
module_usb_driver() macro which makes the code smaller and a bit
simpler.
Added bonus is that it removes some unneeded kernel log messages about
drivers loading and/or unloading.
Cc: "David Täht" <d@teklibre.com>
Cc: Marek Belisko <marek.belisko@gmail.com>
Cc: Al Cho <acho@novell.com>
Cc: Forest Bond <forest@alittletooquiet.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Huajun Li <huajun.li.lee@gmail.com>
Cc: Zac Storer <zac.3.14159@gmail.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: edwin_rong <edwin_rong@realsil.com.cn>
Cc: Ben Hutchings <ben@decadent.org.uk>
Cc: Julia Lawall <julia@diku.dk>
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Joe Perches <joe@perches.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
It was pointed out by 'make versioncheck' that include of
linux/version.h is not needed in drivers/staging/wlan-ng/prism2sta.c .
This patch removes it.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This is a patch to the prism2fw.c file that fixes up a brace
warning found by the checkpatch.pl tool.
Signed-off-by: Joseph Salisbury <salisbury.joseph@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
cfg80211 scan code adds separate BSS entries if the same BSS shows up
on multiple channels. However, sme implementation does not use the
frequency when fetching the BSS entry. Fix this by adding channel
information to cfg80211_roamed() and include it in cfg80211_get_bss()
calls.
Please note that drivers using cfg80211_roamed() need to be modified to
fully implement this fix. This commit includes only minimal changes to
avoid compilation issues; it maintains the old (broken) behavior for
most drivers. ath6kl was the only one that I could test, so I updated
it to provide the operating frequency in the roamed event.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Hi us,
When i was compiling kernel, a warning happened to me.
The warning said like following.
drivers/staging/wlan-ng/cfg80211.c:709: warning: initialization from
incompatible pointer type.
See http://s1202.photobucket.com/albums/bb364/harrywei/?action=view¤t=patched2.png
for more details.
So i patch like following.
Signed-off-by: Harry Wei <harryxiyou@gmail.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch was generated by the following semantic patch:
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);
@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch to p80211conv.c fixes to space coding style warnings found
with checkpatch.pl
Signed-off-by: Adam Thompson <adam@lotpblog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This was necessary in order to resolve some conflicts that happened
between -rc1 and -rc2 with the following files:
drivers/staging/bcm/Bcmchar.c
drivers/staging/intel_sst/intel_sst_app_interface.c
All should be resolved now.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch fixes bug #13820 from bugzilla.kernel.org.
Quote: "If ETHTOOL_GLINK is not defined, the end for switch case is not
to be found."
Signed-off-by: Maximiliano David Bustos <md.bustos90@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Commit e31b82136d ("cfg80211/mac80211:
allow per-station GTKs") changed the signatures of these operations
but did not update the staging drivers.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This is a patch to the p80211netdev.c file that fixes warnings that were
found by the checkpatch.pl tool
Signed-off-by: Johan Meiring <johanmeiring@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This is a patch to the p80211conv.h file that fixes two 80 character
line limit styling issues
Signed-off-by: Johan Meiring <johanmeiring@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This is a patch to prism2mgmt.c that fixes coding style issues found by
checkpatch.pl. Three instances of the 80 char line limit being exceeded
have been kept as is so that string literals are not split up.
Signed-off-by: Johan Meiring <johanmeiring@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This is a patch that fixes various coding style issues in p80211types.h.
The typedef declarations have been kept as they seem necessary.
Signed-off-by: Johan Meiring <johanmeiring@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This is a patch to the p80211netdev.h file that fixes up warnings found
by the checkpatch.pl tool. The typedefs have been left in place as they
seem necessary.
Signed-off-by: Johan Meiring <johanmeiring@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>