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:50:36 +0000 (17:50 +0200)
commit6fb0ccbba9b260feefc1020260e39fd0bdb62b24
tree0b415e79572656a280c1b25e708f3a8c41e4d85d
parentbe794ebace984d408f8cc96befceec0959deb4ae
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