staging: r8188eu: fix rtw_alloc_hwxmits error detection for now
authorPhillip Potter <phil@philpotter.co.uk>
Sat, 21 May 2022 20:47:41 +0000 (21:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jun 2022 12:21:59 +0000 (14:21 +0200)
commitd56bc9e8760ac1b0366678c97d1e92ac4fec79c4
treee08bccd21a6c0d6875951980aa69983743093f0e
parent6a816a0b6cc3ccc9770c4f5571cd99d797e7d15a
staging: r8188eu: fix rtw_alloc_hwxmits error detection for now

[ Upstream commit 5b7419ae1d208cab1e2826d473d8dab045aa75c7 ]

In _rtw_init_xmit_priv, we use the res variable to store the error
return from the newly converted rtw_alloc_hwxmits function. Sadly, the
calling function interprets res using _SUCCESS and _FAIL still, meaning
we change the semantics of the variable, even in the success case.

This leads to the following on boot:
r8188eu 1-2:1.0: _rtw_init_xmit_priv failed

In the long term, we should reverse these semantics, but for now, this
fixes the driver. Also, inside rtw_alloc_hwxmits remove the if blocks,
as HWXMIT_ENTRY is always 4.

Fixes: f94b47c6bde6 ("staging: r8188eu: add check for kzalloc")
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220521204741.921-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/r8188eu/core/rtw_xmit.c