staging: panel: (coding style) Line alignments and malloc sizeof
Style-only modifications to comply with checkpatch.pl --strict --file.
. Correctly realigns the lines that needed to be ;
. Suppress useless blank rows ;
. Fix sizeof() issues in various -malloc() functions.
Signed-off-by: Dominique van den Broeck <domdevlin@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
These issues have been fixed by a concurrent patch:
. missing inclusions of needed header files (fixed by concurrent patch);
. unrequired static function declaration (confusing another *.c file).
Signed-off-by: Dominique van den Broeck <domdevlin@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Thu, 17 Apr 2014 15:35:22 +0000 (10:35 -0500)]
staging: r8188eu: Fix some sparse warnings
In a patch entitles "staging: r8188eu: Fix case where ethtype was never obtained
and always be checked against 0" (commit ID unknown), I introduce an endian error.
This patch fixes that, and removes two additional sparse warnings.
drivers/staging/rtl8188eu/core/rtw_recv.c:653:6: warning: symbol 'process_pwrbit_data' was not declared. Should it be static?
drivers/staging/rtl8188eu/core/rtw_recv.c:1828:5: warning: symbol 'enqueue_reorder_recvframe' was not declared. Should it be static?
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ken Cox [Thu, 22 May 2014 17:31:12 +0000 (12:31 -0500)]
Staging: unisys: Remove unused macros from visorchannel/visorchannel.h
VISORCHANNEL_CHANGE_SERVER_STATE and VISORCHANNEL_CHANGE_CLIENT_STATE
are never used in any of the source so they have been removed.
VISORCHANNEL_CHANGE_CLIENT_STATE would have caused a broken kernel build
after commit a8d7f21d, but since it was never used the kernel continued
to build.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ken Cox <jkc@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Matlack [Fri, 23 May 2014 04:38:45 +0000 (21:38 -0700)]
staging: slicoss: handle errors from slic_config_get
slic_config_get() can fail. Change the return type from void to
int and handle the error in slic_card_init(). So now, instead of
silently failing (and then timing out waiting for the config data),
the driver will fail loudly at request time.
Signed-off-by: David Matlack <matlackdavid@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Matlack [Tue, 20 May 2014 05:04:00 +0000 (22:04 -0700)]
staging: slicoss: fail on corrupt eeprom
Remove fail_on_bad_eeprom, which was always 0 and thus being used
to ignore incorrect checksumming. This means devices with corrupt
eeprom will now cause the driver to fail.
Since fail_on_bad_eeprom was the last member in use of struct
slic_reg_params, remove that struct altogether.
Signed-off-by: David Matlack <matlackdavid@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Matlack [Tue, 20 May 2014 05:03:59 +0000 (22:03 -0700)]
staging: slicoss: fix eeprom checksum code
Rewrite slic_eeprom_cksum() to fix bugs and make readable. This patch
technically has no effect on the user as failed eeprom checksums are
ignored anyway.
The original implementation had the following issues:
1. 2 of the 3 unrolled loops had the following bug:
while ((len -= 32) >= 0) {
[...]
sum += w[15];
w = (u16 *)((ulong) w + 16); /* verify */
}
This processes 32-bytes of data but only increments the word
pointer by 16 bytes. Fixing both of these bugs seems to fix
slic_eeprom_cksum().
2. Non-descriptive variable names, use of unions, and macros that
change local state make the code difficult to read.
3. The checksum loop is unrolled which makes the code harder to
reason about while providing small performance improvement:
- max eeprom length is 0x80 bytes (MAX_EECODE_SIZE), that's
only 0x40 iterations
- checksum is only computed during pci probe(), so not very
often
Tested on Mojave card
Signed-off-by: David Matlack <matlackdavid@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Matlack [Tue, 6 May 2014 04:02:37 +0000 (21:02 -0700)]
staging: slicoss: fix use-after-free bug in slic_entry_remove
This patch fixes a use-after-free bug that causes a null pointer
dereference in slic_entry_halt.
Since unregister_netdev() will ultimately call slic_entry_halt (the
net_device ndo_stop() virtual function for this device), we should
call it before freeing the memory used by slic_entry_halt.
Signed-off-by: David Matlack <dmatlack@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Matlack [Tue, 6 May 2014 04:02:36 +0000 (21:02 -0700)]
staging: slicoss: fix 64-bit isr address bug
This patch fixes a bug that only manifests when the physical address of
the interrupt status register is >4GB. Specifically, the driver was only
telling the device about the lower 32 bits of the ISR. This patch adds
the upper 32 bits.
Signed-off-by: David Matlack <dmatlack@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Matlack [Tue, 6 May 2014 04:02:35 +0000 (21:02 -0700)]
staging: slicoss: fix dma memory leak
This patch fixes a memory leak in slic_card_init. If the driver fails
to poll for an interrupt after requesting config data from the device
the dma memory is never freed.
Signed-off-by: David Matlack <dmatlack@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
As per the TODO file, this patch removes the gratuitous debug
infrastructure. As an extra incentive for removing this code,
the debugfs files are not cleaned up properly. For example, if
register_netdev() fails in slic_entry_probe() then all debugfs
files get left behind, even after the driver module is unloaded.
Touching these files quickly leads to an oops.
Signed-off-by: David Matlack <dmatlack@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Matlack [Tue, 6 May 2014 04:02:32 +0000 (21:02 -0700)]
staging: slicoss: fix multiple free-after-free in slic_entry_remove
This patch fixes two free-after-free bugs in slic_entry_remove.
Specifically, slic_unmap_mmio_space() iounmaps adapter->slic_regs,
which is the same region of memory as dev->base_addr (iounmap-ed
a few lines later).
Next, both release_mem_region() and pci_release_regions() are called
on the same pci_dev struct.
Signed-off-by: David Matlack <dmatlack@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
David Matlack [Tue, 6 May 2014 04:02:31 +0000 (21:02 -0700)]
staging: slicoss: fix use-after-free in slic_entry_probe
This patch fixes a use-after-free bug that can cause a kernel
oops. If slic_card_init fails then slic_entry_probe (the pci
probe() function for this device) will return error without
cleaning up memory.
Signed-off-by: David Matlack <dmatlack@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jes Sorensen [Wed, 21 May 2014 07:38:31 +0000 (09:38 +0200)]
staging: rtl8723au: rtw_cfg80211_monitor_if_xmit_entry() use struct ieee80211_mgmt
Use struct ieee80211_mgmt to parse action frame. In addition remove
unused functions rtw_cfg80211_rx_p2p_action_public() and
rtw_cfg80211_rx_action_p2p()
Jes Sorensen [Wed, 21 May 2014 07:37:59 +0000 (09:37 +0200)]
staging: rtl8723au: Get rid of SetSeqNum()
In every last use case, the header was just cleared with memset() so
there is no need to use the complex SetSeqNum() macro when
cpu_to_le16(IEEE80211_SN_TO_SEQ()) output will do just fine.
In addition, get rid of __le16 *fctrl usage when there is no need for
it.
Control frames will not be fragmented, so we should fully initialize
the seq_ctrl field to zero. This avoids leftover stack bits remaining
set in the generated frame's seq_ctrl field.
Jes Sorensen [Wed, 21 May 2014 07:37:40 +0000 (09:37 +0200)]
staging: rtl8723au: Get rid of struct ndis_802_11_config
This exposed a nice endian bug in collect_bss_info23a() where two
bytes in little-endian order were copied into a u32 and afterwards
le32_to_cpu() was applied to it....
Jes Sorensen [Wed, 21 May 2014 07:37:38 +0000 (09:37 +0200)]
staging: rtl8723au: Make rtw_cfg80211_add_wep() take a struct rtw_wep_key
This allows the removal of the ugly struct ndis_8802_11_wep and simplify
rtw_cfg80211_add_wep(). In addition remove unused element ndiswep from
struct security_priv.