mfd: rtsx_usb: Avoid setting ucr->current_sg.status
authorLu Baolu <baolu.lu@linux.intel.com>
Thu, 11 Aug 2016 02:39:03 +0000 (10:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Oct 2016 15:36:14 +0000 (17:36 +0200)
commit9de8720a92b7189efb6f10655e6c09d0a931875f
tree2cf5cafee68be89e7d7d3bd0fe61a9eb6e43cc62
parenta2afa5f1a3c9b1226451ae05440a2dd344cf34f8
mfd: rtsx_usb: Avoid setting ucr->current_sg.status

commit 8dcc5ff8fcaf778bb57ab4448fedca9e381d088f upstream.

Member "status" of struct usb_sg_request is managed by usb core. A
spin lock is used to serialize the change of it. The driver could
check the value of req->status, but should avoid changing it without
the hold of the spinlock. Otherwise, it could cause race or error
in usb core.

This patch could be backported to stable kernels with version later
than v3.14.

Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Roger Tseng <rogerable@realtek.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mfd/rtsx_usb.c