aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/function/f_ncm.c
diff options
context:
space:
mode:
authorMaciej Żenczykowski <maze@google.com>2021-07-01 04:48:31 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-21 10:04:19 +0200
commitec017d6b60f8aa400987fe95cd839e9ba5dda41d (patch)
tree255b7db453d000e084ceddcf1a0e5220e5714225 /drivers/usb/gadget/function/f_ncm.c
parentusb: gadget: f_ncm: remove spurious boolean timer_stopping (diff)
downloadlinux-dev-ec017d6b60f8aa400987fe95cd839e9ba5dda41d.tar.xz
linux-dev-ec017d6b60f8aa400987fe95cd839e9ba5dda41d.zip
usb: gadget: f_ncm: remove check for NULL skb_tx_data in timer function
This condition is already checked for in ncm_wrap_ntb(), except that that check is done with eth_dev->lock held (it is grabbed by eth_start_xmit). It's best to not be reaching into ncm struct without locks held. Cc: Brooke Basile <brookebasile@gmail.com> Cc: "Bryan O'Donoghue" <bryan.odonoghue@linaro.org> Cc: Felipe Balbi <balbi@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Lorenzo Colitti <lorenzo@google.com> Signed-off-by: Maciej Żenczykowski <maze@google.com> Link: https://lore.kernel.org/r/20210701114834.884597-3-zenczykowski@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/function/f_ncm.c')
-rw-r--r--drivers/usb/gadget/function/f_ncm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c
index e45a938424a4..77f55b3c805a 100644
--- a/drivers/usb/gadget/function/f_ncm.c
+++ b/drivers/usb/gadget/function/f_ncm.c
@@ -1156,8 +1156,7 @@ static enum hrtimer_restart ncm_tx_timeout(struct hrtimer *data)
struct f_ncm *ncm = container_of(data, struct f_ncm, task_timer);
struct net_device *netdev = READ_ONCE(ncm->netdev);
- /* Only send if data is available. */
- if (netdev && ncm->skb_tx_data) {
+ if (netdev) {
/* XXX This allowance of a NULL skb argument to ndo_start_xmit
* XXX is not sane. The gadget layer should be redesigned so
* XXX that the dev->wrap() invocations to build SKBs is transparent