staging: wfx: standardize the error when vif does not exist
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Fri, 9 Oct 2020 17:13:02 +0000 (19:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Oct 2020 10:33:59 +0000 (12:33 +0200)
commitbb97bc286171f58f3286c2d1da876c7a62708ea6
tree2c32951f7c2a73ec489b8a3183bd32837357e12e
parentfd2575c4a45017068445bfe31e93522e2d451d76
staging: wfx: standardize the error when vif does not exist

Smatch complains:

   drivers/staging/wfx/hif_rx.c:177 hif_scan_complete_indication() warn: potential NULL parameter dereference 'wvif'
   drivers/staging/wfx/data_tx.c:576 wfx_flush() warn: potential NULL parameter dereference 'wvif'

Indeed, if the vif id returned by the device does not exist anymore,
wdev_to_wvif() could return NULL.

In add, the error is not handled uniformly in the code, sometime a
WARN() is displayed but code continue, sometime a dev_warn() is
displayed, sometime it is just not tested, ...

This patch standardize that.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20201009171307.864608-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/data_tx.c
drivers/staging/wfx/hif_rx.c
drivers/staging/wfx/sta.c