linux-stable/drivers/staging
Aditya Shankar c2c87f5bf2 staging: wilc1000: Fix problem with wrong vif index
[ Upstream commit 0e490657c7 ]

The vif->idx value is always 0 for two interfaces.

wl->vif_num = 0;

loop {
     ...

     vif->idx = wl->vif_num;
     ...
     wl->vif_num = i;
      ....
     i++;
     ...
}

At present, vif->idx is assigned the value of wl->vif_num
at the beginning of this block and device is initialized
based on this index value.
In the next iteration, wl->vif_num is still 0 as it is only updated
later but gets assigned to vif->idx in the beginning. This causes problems
later when we try to reference a particular interface and also while
configuring the firmware.

This patch moves the assignment to vif->idx from the beginning
of the block to after wl->vif_num is updated with latest value of i.

Fixes: commit 735bb39ca3 ("staging: wilc1000: simplify vif[i]->ndev accesses")
Cc: <stable@vger.kernel.org>
Signed-off-by: Aditya Shankar <aditya.shankar@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-11-10 07:42:50 -08:00
..
android staging: android: ashmem: Fix mmap size validation 2018-10-03 17:01:46 -07:00
board
clocking-wizard
comedi staging: comedi: ni_mio_common: fix subdevice flags for PFI subdevice 2018-09-15 09:42:59 +02:00
dgnc
emxx_udc
fbtft
fsl-mc irqchip/gic-v3: Ignore disabled ITS nodes 2018-05-30 07:50:26 +02:00
fwserial
gdm724x
goldfish
greybus staging: greybus: light: Release memory obtained by kasprintf 2017-12-25 14:23:45 +01:00
gs_fpgaboot
i4l
iio staging: iio: ad5933: switch buffer mode to software 2018-02-25 11:05:45 +01:00
ks7010
lustre staging: lustre: ldlm: free resource when ldlm_lock_create() fails. 2018-08-03 07:55:25 +02:00
media media: staging: omap4iss: Include asm/cacheflush.h after generic includes 2018-09-05 09:20:01 +02:00
most
mt29f_spinand
netlogic
nvec
octeon
octeon-usb
olpc_dcon
rtl8188eu staging: rtl8188eu: Fix incorrect response to SIOCGIWESSID 2018-02-03 17:05:41 +01:00
rtl8192e
rtl8192u staging: rtl8192u: return -ENOMEM on failed allocation of priv->oldaddr 2018-05-25 16:13:05 +02:00
rtl8712 staging: rtl8712: fixed little endian problem 2017-11-21 09:23:27 +01:00
rts5208 staging: rts5208: fix missing error check on call to rtsx_write_register 2018-10-03 17:01:42 -07:00
skein
slicoss
sm750fb
speakup staging: speakup: Replace BUG_ON() with WARN_ON(). 2018-03-22 09:17:36 +01:00
unisys staging: unisys: visorhba: fix s-Par to boot with option CONFIG_VMAP_STACK set to y 2018-03-24 11:00:17 +01:00
vc04_services staging: vchiq_2835_arm: Make cache-line-size a required DT property 2017-10-21 17:21:34 +02:00
vme
vt6655 vt6655: Fix a possible sleep-in-atomic bug in vt6655_suspend 2017-12-20 10:07:33 +01:00
vt6656
wilc1000 staging: wilc1000: Fix problem with wrong vif index 2018-11-10 07:42:50 -08:00
wlan-ng staging: wlan-ng: prism2mgmt.c: fixed a double endian conversion before calling hfa384x_drvr_setconfig16, also fixes relative sparse warning 2018-04-13 19:47:56 +02:00
xgifb
Kconfig
Makefile