OSDN Git Service

staging: r8188eu: Remove _enter/_exit_critical_mutex()
authorFabio M. De Francesco <fmdefrancesco@gmail.com>
Sat, 28 Aug 2021 11:36:56 +0000 (13:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Sep 2021 06:49:49 +0000 (08:49 +0200)
commitd3ede18eeb4645c49c2de6eaad2439626407dd86
tree349155a3d2fabb9e51f101fd14959f3f71465ef9
parentf75a4eec49efcae5cb624462bcb5051c762a871d
staging: r8188eu: Remove _enter/_exit_critical_mutex()

Remove _enter_critical_mutex() and _exit_critical_mutex(). They are
unnecessary wrappers, respectively to mutex_lock_interruptible() and
to mutex_unlock(). They also have an odd interface that takes an unused
argument named pirqL of type unsigned long.
The original code enters the critical section if the mutex API is
interrupted while waiting to acquire the lock; therefore it could lead
to a race condition. Use mutex_lock() because it is uninterruptible and
so avoid that above-mentioned potential race condition.

Tested-by: Pavel Skripkin <paskripkin@gmail.com>
Reviewed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210828113656.6963-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_mlme_ext.c
drivers/staging/r8188eu/hal/usb_ops_linux.c
drivers/staging/r8188eu/include/osdep_service.h
drivers/staging/r8188eu/os_dep/os_intfs.c