diff options
author | David Bauer <mail@david-bauer.net> | 2021-08-19 20:40:29 +0200 |
---|---|---|
committer | David Bauer <mail@david-bauer.net> | 2021-08-24 19:41:47 +0200 |
commit | 378769b5551714ccaa821b481bfeecbf362f351e (patch) | |
tree | 68fdc61b2ff165132b30bf325ab1ba13a8e6a5c1 /target/linux/bcm27xx/patches-5.4/950-0977-USB-gadget-f_hid-avoid-crashes-and-log-spam.patch | |
parent | 662401d903ae542e9868e572e318d5411ec756a7 (diff) | |
download | upstream-378769b5551714ccaa821b481bfeecbf362f351e.tar.gz upstream-378769b5551714ccaa821b481bfeecbf362f351e.tar.bz2 upstream-378769b5551714ccaa821b481bfeecbf362f351e.zip |
kernel: bump 5.4 to 5.4.142
Compile-tested: ath79-generic ipq40xx-generic
Run-tested: ipq40xx-generic
Signed-off-by: David Bauer <mail@david-bauer.net>
Diffstat (limited to 'target/linux/bcm27xx/patches-5.4/950-0977-USB-gadget-f_hid-avoid-crashes-and-log-spam.patch')
-rw-r--r-- | target/linux/bcm27xx/patches-5.4/950-0977-USB-gadget-f_hid-avoid-crashes-and-log-spam.patch | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/target/linux/bcm27xx/patches-5.4/950-0977-USB-gadget-f_hid-avoid-crashes-and-log-spam.patch b/target/linux/bcm27xx/patches-5.4/950-0977-USB-gadget-f_hid-avoid-crashes-and-log-spam.patch deleted file mode 100644 index 1fe685cd99..0000000000 --- a/target/linux/bcm27xx/patches-5.4/950-0977-USB-gadget-f_hid-avoid-crashes-and-log-spam.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 22198e801db7542c59098a75bdab120bcbc42652 Mon Sep 17 00:00:00 2001 -From: Phil Elwell <phil@raspberrypi.com> -Date: Wed, 30 Sep 2020 19:23:43 +0100 -Subject: [PATCH] USB: gadget: f_hid: avoid crashes and log spam - -Disconnecting and reconnecting the USB cable can lead to crashes and a -variety of kernel log spam. Try to fix or minimise both. - -See: https://github.com/raspberrypi/linux/issues/3870 - -Signed-off-by: Phil Elwell <phil@raspberrypi.com> ---- - drivers/usb/gadget/function/f_hid.c | 18 +++++++++++++++++- - 1 file changed, 17 insertions(+), 1 deletion(-) - ---- a/drivers/usb/gadget/function/f_hid.c -+++ b/drivers/usb/gadget/function/f_hid.c -@@ -344,6 +344,11 @@ static ssize_t f_hidg_write(struct file - - spin_lock_irqsave(&hidg->write_spinlock, flags); - -+ if (!hidg->req) { -+ spin_unlock_irqrestore(&hidg->write_spinlock, flags); -+ return -ESHUTDOWN; -+ } -+ - #define WRITE_COND (!hidg->write_pending) - try_again: - /* write queue */ -@@ -364,7 +369,13 @@ try_again: - count = min_t(unsigned, count, hidg->report_length); - - spin_unlock_irqrestore(&hidg->write_spinlock, flags); -- status = copy_from_user(req->buf, buffer, count); -+ if (req) { -+ status = copy_from_user(req->buf, buffer, count); -+ } else { -+ ERROR(hidg->func.config->cdev, "hidg->req is NULL\n"); -+ status = -ESHUTDOWN; -+ goto release_write_pending; -+ } - - if (status != 0) { - ERROR(hidg->func.config->cdev, -@@ -393,6 +404,11 @@ try_again: - - spin_unlock_irqrestore(&hidg->write_spinlock, flags); - -+ if (!hidg->in_ep->enabled) { -+ ERROR(hidg->func.config->cdev, "in_ep is disabled\n"); -+ status = -ESHUTDOWN; -+ goto release_write_pending; -+ } - status = usb_ep_queue(hidg->in_ep, req, GFP_ATOMIC); - if (status < 0) { - ERROR(hidg->func.config->cdev, |